X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/1a949f7c97dc2f34c135f5cdf088df2927d3d652..a67c564e9a6b8779bd6f0ce694b56eaabb337dcb:/forum/middleware/cancel.py?ds=sidebyside diff --git a/forum/middleware/cancel.py b/forum/middleware/cancel.py index 15a4371..9d8f870 100644 --- a/forum/middleware/cancel.py +++ b/forum/middleware/cancel.py @@ -1,6 +1,8 @@ from django.http import HttpResponseRedirect -from forum.utils.forms import get_next_url +from forum.forms import get_next_url import logging +from django.contrib import messages + class CancelActionMiddleware(object): def process_view(self, request, view_func, view_args, view_kwargs): if 'cancel' in request.REQUEST: @@ -9,7 +11,7 @@ class CancelActionMiddleware(object): msg = getattr(view_func,'CANCEL_MESSAGE') except AttributeError: msg = 'action canceled' - request.user.message_set.create(message=msg) + messages.info(request, msg) return HttpResponseRedirect(get_next_url(request)) else: return None