diff options
author | Adolfo Fitoria <adolfo.fitoria@gmail.com> | 2013-01-10 09:21:00 -0600 |
---|---|---|
committer | Adolfo Fitoria <adolfo.fitoria@gmail.com> | 2013-01-10 09:21:00 -0600 |
commit | 31b4af444274fb0bfbf633f12a55e1208ef5ae01 (patch) | |
tree | c9c9964bcbec7a012cca4c9e66c9057dd2391248 /askbot/views | |
parent | 24ef17c6a95c3f52bc2d39061e6ca1fe98b30d25 (diff) | |
parent | 3087781bbba06373797e3010f5ae78abcc9b380a (diff) | |
download | askbot-31b4af444274fb0bfbf633f12a55e1208ef5ae01.tar.gz askbot-31b4af444274fb0bfbf633f12a55e1208ef5ae01.tar.bz2 askbot-31b4af444274fb0bfbf633f12a55e1208ef5ae01.zip |
Merge branch 'master' into tag_subscription
Diffstat (limited to 'askbot/views')
-rw-r--r-- | askbot/views/commands.py | 11 | ||||
-rw-r--r-- | askbot/views/meta.py | 3 | ||||
-rw-r--r-- | askbot/views/writers.py | 5 |
3 files changed, 11 insertions, 8 deletions
diff --git a/askbot/views/commands.py b/askbot/views/commands.py index 0cf4cad2..6153a0ca 100644 --- a/askbot/views/commands.py +++ b/askbot/views/commands.py @@ -920,12 +920,13 @@ def swap_question_with_answer(request): """ if request.user.is_authenticated(): if request.user.is_administrator() or request.user.is_moderator(): - answer = models.Post.objects.get_answers(request.user).get(id = request.POST['answer_id']) + answer = models.Post.objects.get_answers( + request.user + ).get( + id=request.POST['answer_id'] + ) new_question = answer.swap_with_question(new_title = request.POST['new_title']) - return { - 'id': new_question.id, - 'slug': new_question.slug - } + return {'question_url': new_question.get_absolute_url() } raise Http404 @csrf.csrf_exempt diff --git a/askbot/views/meta.py b/askbot/views/meta.py index 092004e7..6714f61e 100644 --- a/askbot/views/meta.py +++ b/askbot/views/meta.py @@ -12,6 +12,7 @@ from django.template.loader import get_template from django.http import HttpResponseRedirect, HttpResponse, Http404 from django.core.urlresolvers import reverse from django.utils.translation import ugettext as _ +from django.utils.translation import ugettext_lazy from django.views import static from django.views.decorators import csrf from django.db.models import Max, Count @@ -127,7 +128,7 @@ def feedback(request): data['form'] = form return render(request, 'feedback.html', data) -feedback.CANCEL_MESSAGE=_('We look forward to hearing your feedback! Please, give it next time :)') +feedback.CANCEL_MESSAGE=ugettext_lazy('We look forward to hearing your feedback! Please, give it next time :)') def privacy(request): data = { diff --git a/askbot/views/writers.py b/askbot/views/writers.py index 58631f9a..bb87d27c 100644 --- a/askbot/views/writers.py +++ b/askbot/views/writers.py @@ -21,6 +21,7 @@ from django.http import HttpResponseRedirect, HttpResponse, HttpResponseForbidde from django.utils import simplejson from django.utils.html import strip_tags, escape from django.utils.translation import ugettext as _ +from django.utils.translation import ugettext_lazy from django.core.urlresolvers import reverse from django.core import exceptions from django.conf import settings @@ -196,7 +197,7 @@ def import_data(request): #@login_required #actually you can post anonymously, but then must register @csrf.csrf_protect -@decorators.check_authorization_to_post(_( +@decorators.check_authorization_to_post(ugettext_lazy( "<span class=\"strong big\">You are welcome to start submitting your question " "anonymously</span>. When you submit the post, you will be redirected to the " "login/signup page. Your question will be saved in the current session and " @@ -527,7 +528,7 @@ def edit_answer(request, id): return HttpResponseRedirect(answer.get_absolute_url()) #todo: rename this function to post_new_answer -@decorators.check_authorization_to_post(_('Please log in to answer questions')) +@decorators.check_authorization_to_post(ugettext_lazy('Please log in to answer questions')) @decorators.check_spam('text') def answer(request, id):#process a new answer """view that posts new answer |