fix topic creation

This commit is contained in:
Pierre Brunet 2017-06-02 10:55:42 +02:00
parent 3521ad699e
commit 1ebfcdedec

View File

@ -155,7 +155,7 @@ class ForumTopicCreateView(CanCreateMixin, CreateView):
return super(ForumTopicCreateView, self).dispatch(request, *args, **kwargs) return super(ForumTopicCreateView, self).dispatch(request, *args, **kwargs)
def form_valid(self, form): def form_valid(self, form):
topic = ForumTopic(title=form.instance.title, author=self.request.user, forum=self.forum) topic = ForumTopic(_title=form.instance.title, author=self.request.user, forum=self.forum)
topic.save() topic.save()
form.instance.topic = topic form.instance.topic = topic
form.instance.author = self.request.user form.instance.author = self.request.user