Stop using "added self" in history entries
authorMagnus Hagander <magnus@hagander.net>
Fri, 6 Feb 2015 11:13:22 +0000 (12:13 +0100)
committerMagnus Hagander <magnus@hagander.net>
Fri, 6 Feb 2015 11:13:22 +0000 (12:13 +0100)
Instead include the actual username. Makes it easier to work with in
the history views, and is also probably more proper english.

pgcommitfest/commitfest/views.py

index 3e0dcd1c7d8b4ee570e2e8a2a107e4490c1833f4..3268b7e5ee9fce69693f4037078b6dfbc3fcb800 100644 (file)
@@ -472,11 +472,11 @@ def reviewer(request, cfid, patchid, status):
        if status=='become' and not is_reviewer:
                patch.reviewers.add(request.user)
                patch.set_modified()
-               PatchHistory(patch=patch, by=request.user, what='Added self as reviewer').save()
+               PatchHistory(patch=patch, by=request.user, what='Added %s as reviewer' % request.user.username).save()
        elif status=='remove' and is_reviewer:
                patch.reviewers.remove(request.user)
                patch.set_modified()
-               PatchHistory(patch=patch, by=request.user, what='Removed self from reviewers').save()
+               PatchHistory(patch=patch, by=request.user, what='Removed %s from reviewers' % request.user.username).save()
        return HttpResponseRedirect('../../')
 
 @login_required
@@ -495,11 +495,11 @@ def committer(request, cfid, patchid, status):
        if status=='become' and not is_committer:
                patch.committer = committer
                patch.set_modified()
-               PatchHistory(patch=patch, by=request.user, what='Added self as committer').save()
+               PatchHistory(patch=patch, by=request.user, what='Added %s as committer' % request.user.username).save()
        elif status=='remove' and is_committer:
                patch.committer = None
                patch.set_modified()
-               PatchHistory(patch=patch, by=request.user, what='Removed self from committers').save()
+               PatchHistory(patch=patch, by=request.user, what='Removed %s from committers' % request.user.username).save()
        patch.save()
        return HttpResponseRedirect('../../')