diff options
author | root <root@u15356270.onlinehome-server.com> | 2009-11-25 17:15:08 -0500 |
---|---|---|
committer | root <root@u15356270.onlinehome-server.com> | 2009-11-25 17:15:08 -0500 |
commit | bf3a507acbc253f436ffc51e2cf8b42b707c617b (patch) | |
tree | e582ba514f05f5565c813a79c6fe31ba071ab0dc /session_messages/.svn/text-base/__init__.py.svn-base | |
parent | f73deac697a396ac1f0e2fd1e0c831a28c990a74 (diff) | |
download | askbot-bf3a507acbc253f436ffc51e2cf8b42b707c617b.tar.gz askbot-bf3a507acbc253f436ffc51e2cf8b42b707c617b.tar.bz2 askbot-bf3a507acbc253f436ffc51e2cf8b42b707c617b.zip |
fixed error in template and removed ADMINS and DEBUG settings from settings.py
Diffstat (limited to 'session_messages/.svn/text-base/__init__.py.svn-base')
-rw-r--r-- | session_messages/.svn/text-base/__init__.py.svn-base | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/session_messages/.svn/text-base/__init__.py.svn-base b/session_messages/.svn/text-base/__init__.py.svn-base deleted file mode 100644 index 0136c888..00000000 --- a/session_messages/.svn/text-base/__init__.py.svn-base +++ /dev/null @@ -1,36 +0,0 @@ -""" -Lightweight session-based messaging system. - -Time-stamp: <2009-03-10 19:22:29 carljm __init__.py> - -""" -VERSION = (0, 1, 'pre') - -def create_message (request, message): - """ - Create a message in the current session. - - """ - assert hasattr(request, 'session'), "django-session-messages requires session middleware to be installed. Edit your MIDDLEWARE_CLASSES setting to insert 'django.contrib.sessions.middleware.SessionMiddleware'." - - try: - request.session['messages'].append(message) - except KeyError: - request.session['messages'] = [message] - -def get_and_delete_messages (request, include_auth=False): - """ - Get and delete all messages for current session. - - Optionally also fetches user messages from django.contrib.auth. - - """ - assert hasattr(request, 'session'), "django-session-messages requires session middleware to be installed. Edit your MIDDLEWARE_CLASSES setting to insert 'django.contrib.sessions.middleware.SessionMiddleware'." - - messages = request.session.pop('messages', []) - - if include_auth and request.user.is_authenticated(): - messages.extend(request.user.get_and_delete_messages()) - - return messages - |