X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/3a404d9e0d6014d16c9222c07a3865500df89e9c..2444d6ffd7995be782615589fb1d5aef2c8277ce:/forum/views/readers.py diff --git a/forum/views/readers.py b/forum/views/readers.py index 8e641bf..f8113be 100644 --- a/forum/views/readers.py +++ b/forum/views/readers.py @@ -167,7 +167,7 @@ def question_list(request, initial, if req_params: req_params = '&' + req_params - feed_url = mark_safe(request.path + "?type=rss" + req_params) + feed_url = mark_safe(escape(request.path + "?type=rss" + req_params)) return pagination.paginated(request, ('questions', paginator_context or QuestionListPaginatorContext()), { "questions" : questions.distinct(), @@ -267,7 +267,7 @@ def answer_redirect(request, answer): else: raise Http404() - count = answer.question.answers.filter(Q(marked=True) | filter).count() + count = answer.question.answers.filter(Q(marked=True) | filter).exclude(state_string="(deleted)").count() pagesize = pc.pagesize(request) page = count / pagesize @@ -314,9 +314,9 @@ def question(request, id, slug='', answer=None): return HttpResponsePermanentRedirect(question.get_absolute_url()) if request.POST: - answer_form = AnswerForm(question, request.POST) + answer_form = AnswerForm(request.POST, user=request.user) else: - answer_form = AnswerForm(question) + answer_form = AnswerForm(user=request.user) answers = request.user.get_visible_answers(question)