diff options
author | root <root@u15356270.onlinehome-server.com> | 2009-11-13 20:18:55 -0500 |
---|---|---|
committer | root <root@u15356270.onlinehome-server.com> | 2009-11-13 20:31:40 -0500 |
commit | 7e4f1d542e00b4d3121da6ae5524e95867f2371b (patch) | |
tree | 5a3edfb81cc137dbc877f75f9bde80e9720b3ba0 /middleware/cancel.py | |
parent | 3a4b6ad43221abc0e0ff345d9368c3348b312128 (diff) | |
download | askbot-7e4f1d542e00b4d3121da6ae5524e95867f2371b.tar.gz askbot-7e4f1d542e00b4d3121da6ae5524e95867f2371b.tar.bz2 askbot-7e4f1d542e00b4d3121da6ae5524e95867f2371b.zip |
better comments, email subscriptions, corrected view counter, some ie7 issues, wiki optional with settings.WIKI_ON, site can be mounted on arbitrary url prefix, english language improvements, added feedback form, versioned css and js files to force browser cache reload when settings.RESOURCE_REVISION is incremented , other fixes
Diffstat (limited to 'middleware/cancel.py')
-rw-r--r-- | middleware/cancel.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/middleware/cancel.py b/middleware/cancel.py new file mode 100644 index 00000000..f03ff35e --- /dev/null +++ b/middleware/cancel.py @@ -0,0 +1,15 @@ +from django.http import HttpResponseRedirect +from django_authopenid.util import get_next_url +import logging +class CancelActionMiddleware(object): + def process_view(self, request, view_func, view_args, view_kwargs): + if 'cancel' in request.REQUEST: + #todo use session messages for the anonymous users + try: + msg = getattr(view_func,'CANCEL_MESSAGE') + except AttributeError: + msg = 'action canceled' + request.user.message_set.create(message=msg) + return HttpResponseRedirect(get_next_url(request)) + else: + return None |