Fixed add work

This commit is contained in:
Tris Forster
2023-02-20 08:03:32 +11:00
parent 5fb5138383
commit 5a201cef85
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -205,7 +205,7 @@ class WorkAddView(CollectionMixin, FormView):
def form_valid(self, form):
work = form.save(commit=False)
#work.ensemble_id = self.request.ensemble_id
work.collection_id = self.kwargs['pk']
work.collection_id = self.collection.pk
work.save()
# handle the files
@@ -217,7 +217,7 @@ class WorkAddView(CollectionMixin, FormView):
if len(docs) == 1:
return redirect('document_annotate', docs[0])
else:
return redirect('work_detail', pk=work.pk)
return redirect('work_detail', collection=self.collection.pk, pk=work.pk)
class WorkMixin(object):