Ticket #4604: __init__.py
File __init__.py, 327 bytes (added by , 17 years ago) |
---|
Line | |
---|---|
1 | class FlashMiddleware: |
2 | def process_response(self, request, response): |
3 | try: |
4 | request.session['flash'] = request.flash |
5 | except: |
6 | pass |
7 | return response |
8 | |
9 | def flash(request): |
10 | if 'flash' in request.session: |
11 | flash = request.session['flash'] |
12 | del request.session['flash'] |
13 | return {'flash': flash} |
14 | return {'flash': None} |