+def convert_to_question(request, id):
+ user = request.user
+
+ node_type = request.GET.get('node_type', 'answer')
+ if node_type == 'comment':
+ node = get_object_or_404(Comment, id=id)
+ action_class = CommentToQuestionAction
+ else:
+ node = get_object_or_404(Answer, id=id)
+ action_class = AnswerToQuestionAction
+
+ if not user.can_convert_to_question(node):
+ return HttpResponseUnauthorized(request)
+
+ return _edit_question(request, node, template='node/convert_to_question.html', summary=_("Converted to question"),
+ action_class =action_class, allow_rollback=False, url_getter=lambda a: Question.objects.get(id=a.id).get_absolute_url())
+