summaryrefslogtreecommitdiffstats
path: root/askbot/utils/decorators.py
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2011-06-23 00:10:20 -0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2011-06-23 00:10:20 -0400
commitc2679f7d4921daea8568b35a544e64ccec065098 (patch)
tree719ac675042cbd22bbb0bbc454c8e244e3f45c0f /askbot/utils/decorators.py
parentb90f79f7a75df6e4fa8528a16d25497153e9c021 (diff)
downloadaskbot-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.py7
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