|
|
|
@ -63,6 +63,13 @@ class StoryPartUpdate(LoginRequiredMixin, UpdateView):
|
|
|
|
|
model = StoryPart
|
|
|
|
|
fields = ['text']
|
|
|
|
|
template_name = 'writingtogether/story_part.html'
|
|
|
|
|
success_url = reverse_lazy('writing:index')
|
|
|
|
|
|
|
|
|
|
def get_context_data(self, **kwargs):
|
|
|
|
|
context = super(StoryPartUpdate, self).get_context_data(**kwargs)
|
|
|
|
|
context.update(self.kwargs)
|
|
|
|
|
return context
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#def form_valid(self, form):
|
|
|
|
|
# form.instance.created_by = self.request.user
|
|
|
|
@ -82,5 +89,5 @@ class RedirectToNextOpenPart(LoginRequiredMixin, RedirectView):
|
|
|
|
|
story_part = story_round.get_next_story_part(user=self.request.user)
|
|
|
|
|
|
|
|
|
|
kwargs['story_pk'] = story_part.part_of.pk
|
|
|
|
|
kwargs['story_part_pk'] = story_part.pk
|
|
|
|
|
kwargs['pk'] = story_part.pk
|
|
|
|
|
return super().get_redirect_url(*args, **kwargs)
|
|
|
|
|