# HG changeset patch # User neko259 # Date 2015-01-03 15:45:47 # Node ID 90224a9f4986299ee96e6eb082aa1a2d81a86b34 # Parent 00031b0b7bca9538a4cb9c0a7619178e6d48d6a4 Cleaned up some code diff --git a/boards/abstracts/settingsmanager.py b/boards/abstracts/settingsmanager.py --- a/boards/abstracts/settingsmanager.py +++ b/boards/abstracts/settingsmanager.py @@ -5,6 +5,7 @@ from boards.models import Tag SESSION_SETTING = 'setting' +# Remove this, it is not used any more cause there is a user's permission PERMISSION_MODERATE = 'moderator' SETTING_THEME = 'theme' diff --git a/boards/context_processors.py b/boards/context_processors.py --- a/boards/context_processors.py +++ b/boards/context_processors.py @@ -1,5 +1,4 @@ -from boards.abstracts.settingsmanager import PERMISSION_MODERATE, \ - get_settings_manager +from boards.abstracts.settingsmanager import get_settings_manager __author__ = 'neko259' @@ -19,7 +18,7 @@ PERMISSION_MODERATE = 'moderation' def user_and_ui_processor(request): - context = {} + context = dict() context[CONTEXT_PPD] = float(Post.objects.get_posts_per_day()) @@ -31,7 +30,7 @@ def user_and_ui_processor(request): # This shows the moderator panel try: - moderate = request.user.has_perm('moderation') + moderate = request.user.has_perm(PERMISSION_MODERATE) except AttributeError: moderate = False context[CONTEXT_MODERATOR] = moderate