From d5c66ac155e1749968ccae7540cf95e20a5511bf Mon Sep 17 00:00:00 2001 From: Jorran de Wit <jorrandewit@outlook.com> Date: Fri, 9 Feb 2018 11:53:04 +0100 Subject: [PATCH] Fix manager --- scipost/managers.py | 2 +- submissions/forms.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scipost/managers.py b/scipost/managers.py index 5ed6efd72..fcb78b3d9 100644 --- a/scipost/managers.py +++ b/scipost/managers.py @@ -25,7 +25,7 @@ class ContributorQuerySet(models.QuerySet): def available(self): return self.exclude( unavailability_periods__start__lte=today, - unavailability_periods__end__lte=today) + unavailability_periods__end__gte=today) def awaiting_validation(self): return self.filter(user__is_active=False, status=CONTRIBUTOR_NEWLY_REGISTERED) diff --git a/submissions/forms.py b/submissions/forms.py index 378403164..99ec16dd5 100644 --- a/submissions/forms.py +++ b/submissions/forms.py @@ -435,7 +435,7 @@ class EditorialAssignmentForm(forms.ModelForm): self.submission = kwargs.pop('submission') super().__init__(*args, **kwargs) self.fields['to'].queryset = Contributor.objects.available().filter( - fellowships__pool=self.submission).distinct() + fellowships__pool=self.submission).distinct().order_by('user__last_name') def save(self, commit=True): self.instance.submission = self.submission -- GitLab