Skip to content

Commit

Permalink
Fix errors on revert/undo message generation when using nonstandard a…
Browse files Browse the repository at this point in the history
…uth module
  • Loading branch information
emesik committed Sep 15, 2013
1 parent 3672834 commit 1885299
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions djiki/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,9 @@ def revert(request, title, revision_pk):
reverse('djiki-page-view', kwargs={'title': url_title}))
else:
if src_revision.author:
description = _("Reverted to revision of %(time)s by %(user)s.") % \
{'time': src_revision.created, 'user': src_revision.user.username}
description = _("Reverted to revision of %(time)s by %(author)s.") % \
{'time': src_revision.created,
'author': getattr(src_revision.author, src_revision.author.USERNAME_FIELD)}
else:
description = _("Reverted to anonymous revision of %(time)s.") % \
{'time': src_revision.created}
Expand Down Expand Up @@ -181,8 +182,9 @@ def undo(request, title, revision_pk):
reverse('djiki-page-view', kwargs={'title': url_title}))
else:
if src_revision.author:
description = _("Undid revision of %(time)s by %(user)s.") % \
{'time': src_revision.created, 'user': src_revision.user.username}
description = _("Undid revision of %(time)s by %(author)s.") % \
{'time': src_revision.created,
'author': getattr(src_revision.author, src_revision.author.USERNAME_FIELD)}
else:
description = _("Undid anonymous revision of %(time)s.") % {'time': src_revision.created}
try:
Expand Down

0 comments on commit 1885299

Please sign in to comment.