diff options
-rw-r--r-- | askbot/__init__.py | 2 | ||||
-rw-r--r-- | askbot/deps/django_authopenid/views.py | 2 | ||||
-rw-r--r-- | askbot/deps/group_messaging/views.py | 4 | ||||
-rw-r--r-- | askbot/utils/decorators.py | 6 | ||||
-rw-r--r-- | askbot/views/api_v1.py | 10 | ||||
-rw-r--r-- | askbot/views/commands.py | 14 | ||||
-rw-r--r-- | askbot/views/readers.py | 4 | ||||
-rw-r--r-- | askbot/views/widgets.py | 4 | ||||
-rw-r--r-- | askbot/views/writers.py | 14 | ||||
-rw-r--r-- | askbot_requirements.txt | 2 | ||||
-rw-r--r-- | askbot_requirements_dev.txt | 2 |
11 files changed, 32 insertions, 32 deletions
diff --git a/askbot/__init__.py b/askbot/__init__.py index 40a2eedb..0e4ba506 100644 --- a/askbot/__init__.py +++ b/askbot/__init__.py @@ -27,7 +27,7 @@ REQUIREMENTS = { 'sanction': 'sanction==0.3.1', 'unidecode': 'unidecode', 'django_countries': 'django-countries==1.0.5', - 'djcelery': 'django-celery==3.0.11', + 'djcelery': 'django-celery>=3.0.11', 'djkombu': 'django-kombu==0.9.4', 'followit': 'django-followit', 'recaptcha_works': 'django-recaptcha-works', diff --git a/askbot/deps/django_authopenid/views.py b/askbot/deps/django_authopenid/views.py index ac106777..e1a3b981 100644 --- a/askbot/deps/django_authopenid/views.py +++ b/askbot/deps/django_authopenid/views.py @@ -838,7 +838,7 @@ def change_password(request): data['message'] = _('Your new password is saved') else: data['errors'] = form.errors - return HttpResponse(simplejson.dumps(data), mimetype='application/json') + return HttpResponse(simplejson.dumps(data), content_type='application/json') @login_required def delete_login_method(request): diff --git a/askbot/deps/group_messaging/views.py b/askbot/deps/group_messaging/views.py index 244762d1..f2ddaef3 100644 --- a/askbot/deps/group_messaging/views.py +++ b/askbot/deps/group_messaging/views.py @@ -45,7 +45,7 @@ class InboxView(object): template = get_template(template_name) html = template.render(context) json = simplejson.dumps({'html': html, 'success': True}) - return HttpResponse(json, mimetype='application/json') + return HttpResponse(json, content_type='application/json') def get(self, request, *args, **kwargs): @@ -120,7 +120,7 @@ class NewThread(InboxView): ) result['success'] = True result['message_id'] = message.id - return HttpResponse(simplejson.dumps(result), mimetype='application/json') + return HttpResponse(simplejson.dumps(result), content_type='application/json') class PostReply(InboxView): diff --git a/askbot/utils/decorators.py b/askbot/utils/decorators.py index 1cf20059..815e6e2d 100644 --- a/askbot/utils/decorators.py +++ b/askbot/utils/decorators.py @@ -42,7 +42,7 @@ def ajax_login_required(view_func): return view_func(request, *args, **kwargs) else: json = simplejson.dumps({'login_required':True}) - return HttpResponseForbidden(json, mimetype='application/json') + return HttpResponseForbidden(json, content_type='application/json') return wrap @@ -107,7 +107,7 @@ def ajax_only(view_func): 'message': message, 'success': 0 } - return HttpResponse(simplejson.dumps(data), mimetype='application/json') + return HttpResponse(simplejson.dumps(data), content_type='application/json') if isinstance(data, HttpResponse):#is this used? data.mimetype = 'application/json' @@ -115,7 +115,7 @@ def ajax_only(view_func): else: data['success'] = 1 json = simplejson.dumps(data) - return HttpResponse(json, mimetype='application/json') + return HttpResponse(json, content_type='application/json') return wrapper def check_authorization_to_post(func_or_message): diff --git a/askbot/views/api_v1.py b/askbot/views/api_v1.py index d55c8462..c8cab137 100644 --- a/askbot/views/api_v1.py +++ b/askbot/views/api_v1.py @@ -64,7 +64,7 @@ def info(request): data['groups'] = 0 json_string = simplejson.dumps(data) - return HttpResponse(json_string, mimetype='application/json') + return HttpResponse(json_string, content_type='application/json') def user(request, user_id): ''' @@ -76,7 +76,7 @@ def user(request, user_id): data['answers'] = models.Post.objects.get_answers(user).count() data['comments'] = models.Post.objects.filter(post_type='comment').count() json_string = simplejson.dumps(data) - return HttpResponse(json_string, mimetype='application/json') + return HttpResponse(json_string, content_type='application/json') def users(request): @@ -126,7 +126,7 @@ def users(request): } json_string = simplejson.dumps(response_dict) - return HttpResponse(json_string, mimetype='application/json') + return HttpResponse(json_string, content_type='application/json') def question(request, question_id): @@ -141,7 +141,7 @@ def question(request, question_id): ) datum = get_question_data(post.thread) json_string = simplejson.dumps(datum) - return HttpResponse(json_string, mimetype='application/json') + return HttpResponse(json_string, content_type='application/json') def questions(request): @@ -196,4 +196,4 @@ def questions(request): 'questions': question_list } response_data = simplejson.dumps(ajax_data) - return HttpResponse(response_data, mimetype='application/json') + return HttpResponse(response_data, content_type='application/json') diff --git a/askbot/views/commands.py b/askbot/views/commands.py index 52918ce8..2ccad9d5 100644 --- a/askbot/views/commands.py +++ b/askbot/views/commands.py @@ -131,7 +131,7 @@ def manage_inbox(request): response_data['success'] = True data = simplejson.dumps(response_data) - return HttpResponse(data, mimetype="application/json") + return HttpResponse(data, content_type="application/json") else: raise exceptions.PermissionDenied( _('Sorry, but anonymous users cannot access the inbox') @@ -148,7 +148,7 @@ def manage_inbox(request): response_data['message'] = message response_data['success'] = False data = simplejson.dumps(response_data) - return HttpResponse(data, mimetype="application/json") + return HttpResponse(data, content_type="application/json") def process_vote(user = None, vote_direction = None, post = None): @@ -435,7 +435,7 @@ def vote(request): response_data['message'] = unicode(e) response_data['success'] = 0 data = simplejson.dumps(response_data) - return HttpResponse(data, mimetype="application/json") + return HttpResponse(data, content_type="application/json") #internally grouped views - used by the tagging system @csrf.csrf_exempt @@ -479,7 +479,7 @@ def mark_tag(request, **kwargs):#tagging system else: tag_usage_counts[name] = 0 - return HttpResponse(simplejson.dumps(tag_usage_counts), mimetype="application/json") + return HttpResponse(simplejson.dumps(tag_usage_counts), content_type="application/json") #@decorators.ajax_only @decorators.get_only @@ -513,7 +513,7 @@ def get_thread_shared_users(request): 'users_count': users.count(), 'success': True }) - return HttpResponse(re_data, mimetype='application/json') + return HttpResponse(re_data, content_type='application/json') @decorators.get_only def get_thread_shared_groups(request): @@ -529,7 +529,7 @@ def get_thread_shared_groups(request): 'groups_count': groups.count(), 'success': True }) - return HttpResponse(re_data, mimetype='application/json') + return HttpResponse(re_data, content_type='application/json') @decorators.ajax_only def get_html_template(request): @@ -1534,7 +1534,7 @@ def get_editor(request): 'scripts': parsed_scripts, 'success': True } - return HttpResponse(simplejson.dumps(data), mimetype='application/json') + return HttpResponse(simplejson.dumps(data), content_type='application/json') @csrf.csrf_exempt @decorators.ajax_only diff --git a/askbot/views/readers.py b/askbot/views/readers.py index 3c3b053c..80f1d2ec 100644 --- a/askbot/views/readers.py +++ b/askbot/views/readers.py @@ -298,7 +298,7 @@ def get_top_answers(request): 'html': answers_html, 'num_answers': paginator.count} ) - return HttpResponse(json_string, mimetype='application/json') + return HttpResponse(json_string, content_type='application/json') else: return HttpResponseBadRequest() @@ -374,7 +374,7 @@ def tags(request):#view showing a listing of available tags - plain list template_context = RequestContext(request, data) json_data = {'success': True, 'html': template.render(template_context)} json_string = simplejson.dumps(json_data) - return HttpResponse(json_string, mimetype='application/json') + return HttpResponse(json_string, content_type='application/json') else: return render(request, 'tags.html', data) diff --git a/askbot/views/widgets.py b/askbot/views/widgets.py index c049f91d..41cf4c8f 100644 --- a/askbot/views/widgets.py +++ b/askbot/views/widgets.py @@ -245,7 +245,7 @@ def render_ask_widget_js(request, widget_id): 'variable_name': variable_name } content = content_tpl.render(RequestContext(request, context_dict)) - return HttpResponse(content, mimetype='text/javascript') + return HttpResponse(content, content_type='text/javascript') def render_ask_widget_css(request, widget_id): widget = get_object_or_404(models.AskWidget, pk=widget_id) @@ -258,7 +258,7 @@ def render_ask_widget_css(request, widget_id): 'variable_name': variable_name } content = content_tpl.render(RequestContext(request, context_dict)) - return HttpResponse(content, mimetype='text/css') + return HttpResponse(content, content_type='text/css') def question_widget(request, widget_id): """Returns the first x questions based on certain tags. diff --git a/askbot/views/writers.py b/askbot/views/writers.py index 395ba3d8..e0d8e1f4 100644 --- a/askbot/views/writers.py +++ b/askbot/views/writers.py @@ -127,7 +127,7 @@ def upload(request):#ajax upload file to a question or answer xml_template = "<result><msg><![CDATA[%s]]></msg><error><![CDATA[%s]]></error><file_url>%s</file_url><orig_file_name><![CDATA[%s]]></orig_file_name></result>" xml = xml_template % (result, error, file_url, orig_file_name) - return HttpResponse(xml, mimetype="application/xml") + return HttpResponse(xml, content_type="application/xml") def __import_se_data(dump_file): """non-view function that imports the SE data @@ -193,7 +193,7 @@ def import_data(request): dump_storage.flush() return HttpResponse(__import_se_data(dump_storage)) - #yield HttpResponse(_('StackExchange import complete.'), mimetype='text/plain') + #yield HttpResponse(_('StackExchange import complete.'), content_type='text/plain') #dump_storage.close() else: form = forms.DumpUploadForm() @@ -351,7 +351,7 @@ def retag_question(request, id): response_data['message'] = message data = simplejson.dumps(response_data) - return HttpResponse(data, mimetype="application/json") + return HttpResponse(data, content_type="application/json") else: return HttpResponseRedirect(question.get_absolute_url()) elif request.is_ajax(): @@ -360,7 +360,7 @@ def retag_question(request, id): 'success': False } data = simplejson.dumps(response_data) - return HttpResponse(data, mimetype="application/json") + return HttpResponse(data, content_type="application/json") else: form = forms.RetagQuestionForm(question) @@ -377,7 +377,7 @@ def retag_question(request, id): 'success': False } data = simplejson.dumps(response_data) - return HttpResponse(data, mimetype="application/json") + return HttpResponse(data, content_type="application/json") else: request.user.message_set.create(message = unicode(e)) return HttpResponseRedirect(question.get_absolute_url()) @@ -697,7 +697,7 @@ def __generate_comments_json(obj, user):#non-view generates json data for the po json_comments.append(comment_data) data = simplejson.dumps(json_comments) - return HttpResponse(data, mimetype="application/json") + return HttpResponse(data, content_type="application/json") @csrf.csrf_exempt @decorators.check_spam('comment') @@ -757,7 +757,7 @@ def post_comments(request):#generic ajax handler to load comments to an object ) response = __generate_comments_json(post, user) except exceptions.PermissionDenied, e: - response = HttpResponseForbidden(unicode(e), mimetype="application/json") + response = HttpResponseForbidden(unicode(e), content_type="application/json") return response diff --git a/askbot_requirements.txt b/askbot_requirements.txt index 658d2760..3b9fde6e 100644 --- a/askbot_requirements.txt +++ b/askbot_requirements.txt @@ -12,7 +12,7 @@ django-threaded-multihost django-robots unidecode django-countries==1.0.5 -django-celery==2.2.7 +django-celery>=3.0.11 django-kombu==0.9.2 django-followit django-recaptcha-works diff --git a/askbot_requirements_dev.txt b/askbot_requirements_dev.txt index a5d98d97..476ed66f 100644 --- a/askbot_requirements_dev.txt +++ b/askbot_requirements_dev.txt @@ -15,7 +15,7 @@ django-threaded-multihost django-robots unidecode django-countries==1.0.5 -django-celery==2.2.7 +django-celery>=3.0.11 django-kombu==0.9.2 django-followit django-recaptcha-works |