From 0df2763af613ff7e52a6d823b1c99787b3dc7db1 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Wed, 29 Oct 2008 11:38:42 +0100 Subject: [PATCH] Wrap the free_comment view instead of the comment view. This allows us to work with no changes to threaded_comments at all. --- influences/views.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/influences/views.py b/influences/views.py index ca1a1e1..6a6f874 100644 --- a/influences/views.py +++ b/influences/views.py @@ -11,7 +11,7 @@ from django.http import HttpResponseRedirect, HttpResponseForbidden from django.views.generic.list_detail import object_detail, object_list from threadedcomments.models import ThreadedComment from threadedcomments.forms import ThreadedCommentForm -from threadedcomments.views import comment +from threadedcomments.views import free_comment from xerxes.influences.models import Character from xerxes.influences.models import Influence from xerxes.tools.forms import ContextModelForm @@ -191,6 +191,10 @@ def influence_comment(request, edit_id=None, *args, **kwargs): reply_to = None # Find the right form class kwargs['form_class'] = get_influence_comment_form(request.user.is_staff, reply_to) - return comment(request, edit_id=edit_id, *args, **kwargs) + # Override the model, so we don't get a free comment, but a normal + # one. We can't use threadedcomments' comment view for that, since + # that hardcodes the form_class. + kwargs['model'] = ThreadedComment + return free_comment(request, edit_id=edit_id, *args, **kwargs) # vim: set sts=4 sw=4 expandtab: -- 2.30.2