diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2010-11-08 00:39:32 -0500 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2010-11-08 00:39:32 -0500 |
commit | 96a7854e151235bbc553cf3ffa26cd2b21e32dfa (patch) | |
tree | ecdf330b91d6aa71ed6ee8b07e49b40d5e14377a /askbot/context.py | |
parent | ae53fef954ff88a3b594c14a84639a679b6d6dc1 (diff) | |
download | askbot-96a7854e151235bbc553cf3ffa26cd2b21e32dfa.tar.gz askbot-96a7854e151235bbc553cf3ffa26cd2b21e32dfa.tar.bz2 askbot-96a7854e151235bbc553cf3ffa26cd2b21e32dfa.zip |
inbox with persistent responses and flags sort of works, but neds testing on correctness
Diffstat (limited to 'askbot/context.py')
-rw-r--r-- | askbot/context.py | 30 |
1 files changed, 4 insertions, 26 deletions
diff --git a/askbot/context.py b/askbot/context.py index 73f6018a..59056003 100644 --- a/askbot/context.py +++ b/askbot/context.py @@ -1,35 +1,13 @@ from django.conf import settings from askbot.conf import settings as askbot_settings +from askbot import api import datetime -def application_settings(context): +def application_settings(request): my_settings = askbot_settings.as_dict() my_settings['LANGUAGE_CODE'] = settings.LANGUAGE_CODE my_settings['ASKBOT_URL'] = settings.ASKBOT_URL - return {'settings':my_settings} - -def auth_processor(request): - """ - Returns context variables required by apps that use Django's authentication - system. - - If there is no 'user' attribute in the request, uses AnonymousUser (from - django.contrib.auth). - """ - if hasattr(request, 'user'): - user = request.user - if user.is_authenticated(): - messages = user.message_set.all() - else: - messages = None - else: - from django.contrib.auth.models import AnonymousUser - user = AnonymousUser() - messages = None - - from django.core.context_processors import PermWrapper return { - 'user': user, - 'messages': messages, - 'perms': PermWrapper(user), + 'settings': my_settings, + 'moderation_items': api.get_info_on_moderation_items(request.user) } |