Mercurial > public > sg101
diff antispam/decorators.py @ 692:4a49d4ac319f
For #51, remove the ajax popup login window.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Sun, 01 Sep 2013 15:58:45 -0500 |
parents | 988782c6ce6c |
children |
line wrap: on
line diff
--- a/antispam/decorators.py Sun Sep 01 11:59:28 2013 -0500 +++ b/antispam/decorators.py Sun Sep 01 15:58:45 2013 -0500 @@ -2,7 +2,6 @@ This module contains decorators for the antispam application. """ -import json from functools import wraps import logging @@ -19,16 +18,10 @@ if request.method == 'POST': - # Figure out if the view succeeded; if it is a non-ajax view, - # then success means a redirect is about to occur. If it is - # an ajax view, we have to decode the json response. - success = False - if not request.is_ajax(): - success = (response and response.has_header('location') and - response.status_code == 302) - elif response: - json_resp = json.loads(response.content) - success = json_resp['success'] + # Figure out if the view succeeded; success means a redirect is + # about to occur. + success = (response and response.has_header('location') and + response.status_code == 302) if not success: username = request.POST.get('username')