diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2011-06-23 00:10:20 -0400 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2011-06-23 00:10:20 -0400 |
commit | c2679f7d4921daea8568b35a544e64ccec065098 (patch) | |
tree | 719ac675042cbd22bbb0bbc454c8e244e3f45c0f /askbot/utils/decorators.py | |
parent | b90f79f7a75df6e4fa8528a16d25497153e9c021 (diff) | |
download | askbot-c2679f7d4921daea8568b35a544e64ccec065098.tar.gz askbot-c2679f7d4921daea8568b35a544e64ccec065098.tar.bz2 askbot-c2679f7d4921daea8568b35a544e64ccec065098.zip |
changed ajax_only decorator to return status 200 even if there was error, like permission denied as more rigorous handling for some reason prevented apache from transmitting documents correctly
Diffstat (limited to 'askbot/utils/decorators.py')
-rw-r--r-- | askbot/utils/decorators.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/askbot/utils/decorators.py b/askbot/utils/decorators.py index fb093421..f2c86cd5 100644 --- a/askbot/utils/decorators.py +++ b/askbot/utils/decorators.py @@ -87,12 +87,17 @@ def ajax_only(view_func): if message == '': message = _('Oops, apologies - there was some error') logging.debug(message) - return HttpResponse(message, status = 404, mimetype='application/json') + data = { + 'message': message, + 'success': 0 + } + return HttpResponse(simplejson.dumps(data), mimetype='application/json') if isinstance(data, HttpResponse):#is this used? data.mimetype = 'application/json' return data else: + data['success'] = 1 json = simplejson.dumps(data) return HttpResponse(json,mimetype='application/json') return wrapper |