Couple of interface tweeks
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user