From 7e4f1d542e00b4d3121da6ae5524e95867f2371b Mon Sep 17 00:00:00 2001 From: root Date: Fri, 13 Nov 2009 20:18:55 -0500 Subject: 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 --- middleware/cancel.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 middleware/cancel.py (limited to 'middleware/cancel.py') 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 -- cgit v1.2.3-1-g7c22