From e5f4e36b107c2416b3af4a2869c6c1f4240ce6b8 Mon Sep 17 00:00:00 2001 From: Evgeny Fadeev Date: Thu, 10 Jul 2014 07:35:28 -0300 Subject: show new user status in the profile --- askbot/models/__init__.py | 16 +++++++--------- askbot/templates/user_profile/user_info.html | 2 +- askbot/views/users.py | 1 - 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/askbot/models/__init__.py b/askbot/models/__init__.py index c80c57b5..beff6621 100644 --- a/askbot/models/__init__.py +++ b/askbot/models/__init__.py @@ -2272,21 +2272,19 @@ def user_moderate_user_reputation( repute.positive = reputation_change repute.save() -def user_get_status_display(self, soft = False): - if self.is_administrator(): - return _('Site Adminstrator') +def user_get_status_display(self): + if self.is_approved(): + return _('Registered User') + elif self.is_administrator(): + return _('Adminstrator') elif self.is_moderator(): - return _('Forum Moderator') + return _('Moderator') elif self.is_suspended(): return _('Suspended User') elif self.is_blocked(): return _('Blocked User') - elif soft == True: - return _('Registered User') elif self.is_watched(): - return _('Watched User') - elif self.is_approved(): - return _('Approved User') + return _('New User') else: raise ValueError('Unknown user status') diff --git a/askbot/templates/user_profile/user_info.html b/askbot/templates/user_profile/user_info.html index 6a9ff91e..9e1adcca 100644 --- a/askbot/templates/user_profile/user_info.html +++ b/askbot/templates/user_profile/user_info.html @@ -46,7 +46,7 @@ {% endif %} -

{{user_status_for_display}}

+

{{ view_user.get_status_display() }}

{% if view_user.real_name %} diff --git a/askbot/views/users.py b/askbot/views/users.py index 7c3c87c3..09c4e987 100644 --- a/askbot/views/users.py +++ b/askbot/views/users.py @@ -541,7 +541,6 @@ def user_stats(request, user, context): 'support_custom_avatars': ('avatar' in django_settings.INSTALLED_APPS), 'tab_name' : 'stats', 'page_title' : _('user profile overview'), - 'user_status_for_display': user.get_status_display(soft = True), 'questions' : questions, 'question_count': question_count, 'q_paginator_context': q_paginator_context, -- cgit v1.2.3-1-g7c22