Couple of interface tweeks

This commit is contained in:
Tris Forster
2023-02-28 16:56:22 +11:00
parent 7d4f959146
commit f840ee3d8b
8 changed files with 28 additions and 21 deletions
+2 -2
View File
@@ -253,7 +253,7 @@ class WorkAddToProject(CollectionMixin, FormView):
def get_form(self):
f = super(WorkAddToProject, self).get_form()
qs = f.fields['project'].queryset
qs = f.fields['project'].queryset.select_related('ensemble')
# Limit to projects for ensembles where we are an admin and they haven't occured yet
qs = qs.for_user(self.request.user).current()
@@ -262,7 +262,7 @@ class WorkAddToProject(CollectionMixin, FormView):
work = self.get_object()
qs = qs.exclude(pk__in=work.projects.all())
f.fields['project'].queryset = qs
f.fields['project'].queryset = qs.order_by('ensemble__name', 'name')
return f
def form_valid(self, form):