X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/be26ac9493b40e87e07c773a8d7c79ef1e8b7b48..786e1bae7fc276a0c49c4aeb98646a9ba8935c77:/forum/views/writers.py?ds=sidebyside diff --git a/forum/views/writers.py b/forum/views/writers.py index 99e9377..aace1f6 100644 --- a/forum/views/writers.py +++ b/forum/views/writers.py @@ -17,7 +17,7 @@ from forum.actions import AskAction, AnswerAction, ReviseAction, RollbackAction, from forum.modules.decorators import decoratable from forum.forms import * from forum.models import * -from forum.utils.forms import get_next_url +from forum.forms import get_next_url def upload(request):#ajax upload file to a question or answer @@ -67,7 +67,7 @@ def upload(request):#ajax upload file to a question or answer @decoratable def ask(request): if request.POST and "text" in request.POST: - form = AskForm(request.POST) + form = AskForm(request.POST, user=request.user) if form.is_valid(): if request.user.is_authenticated(): ask_action = AskAction(user=request.user, ip=request.META['REMOTE_ADDR']).save(data=form.cleaned_data) @@ -82,14 +82,12 @@ def ask(request): request.session['temp_node_type'] = 'question' return HttpResponseRedirect(reverse('auth_action_signin', kwargs={'action': 'newquestion'})) elif request.method == "POST" and "go" in request.POST: - form = AskForm({'title': request.POST['q']}) + form = AskForm({'title': request.POST['q']}, user=request.user) else: - form = AskForm() + form = AskForm(user=request.user) - #tags = _get_tags_cache_json() return render_to_response('ask.html', { 'form' : form, - #'tags' : tags, 'email_validation_faq_url':reverse('faq') + '#validate', }, context_instance=RequestContext(request))