[extensions-web] ratings: return reserved "nobody" username for deleted accounts
- From: Yuri Konotopov <ykonotopov src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [extensions-web] ratings: return reserved "nobody" username for deleted accounts
- Date: Thu, 1 Dec 2016 15:00:21 +0000 (UTC)
commit 3e609c6b7ad027a3086507c72ad4d74cb108f3e1
Author: Yuri Konotopov <ykonotopov gnome org>
Date: Thu Dec 1 17:59:44 2016 +0300
ratings: return reserved "nobody" username for deleted accounts
sweettooth/ratings/views.py | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/sweettooth/ratings/views.py b/sweettooth/ratings/views.py
index b3fc87b..e31b9eb 100644
--- a/sweettooth/ratings/views.py
+++ b/sweettooth/ratings/views.py
@@ -21,12 +21,13 @@ def comment_details(request, comment):
extension = comment.content_object
gravatar = gravatar_url(request, comment.email)
is_extension_creator = (comment.user == extension.creator)
+ username = comment.user.username if comment.user else "nobody"
details = dict(gravatar = gravatar,
is_extension_creator = is_extension_creator,
comment = comment.comment,
- author = dict(username=comment.user.username,
- url=reverse('auth-profile', kwargs=dict(user=comment.user.username))),
+ author = dict(username=username,
+ url=reverse('auth-profile', kwargs=dict(user=username))),
date = dict(timestamp = comment.submit_date.isoformat(),
standard = format_date(comment.submit_date, 'F j, Y')))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]