Moved project filtering to the right place - the queryset

This commit is contained in:
Tris Forster
2023-02-23 19:18:23 +11:00
parent dbbfa79f10
commit d7892d355d
3 changed files with 22 additions and 18 deletions
+1 -1
View File
@@ -262,7 +262,7 @@ class WorkAddToProject(CollectionMixin, FormView):
qs = f.fields['project'].queryset
# Limit to projects for ensembles where we are an admin and they haven't occured yet
qs = qs.filter(ensemble__admins=self.request.user, event_date__gt=now())
qs = qs.for_user(self.request.user).current()
# dont show projects already added to
work = self.get_object()