diff --git a/scipost_django/colleges/forms.py b/scipost_django/colleges/forms.py index 6dd25ecd1f44b58649e85727e45572e68ef458b7..7705205a9ccf0fbbcc5d22f3749b29ecf301ea45 100644 --- a/scipost_django/colleges/forms.py +++ b/scipost_django/colleges/forms.py @@ -1342,12 +1342,16 @@ class FellowshipsMonitorSearchForm(forms.Form): orderby = forms.ChoiceField( label="Order by", choices=[ + ("", "-----"), + ("contributor__profile__last_name", "Fellow"), ("nr_in_pool", "# in pool"), ("nr_appraised", "# appraised"), ("nr_assignments_completed", "# completed"), + ("nr_assignments_ongoing", "# ongoing"), ("start_date", "Start date"), ("until_date", "End date"), ], + initial="", required=False, ) ordering = forms.ChoiceField( @@ -1627,7 +1631,7 @@ class FellowshipsMonitorSearchForm(forms.Form): if not self.cleaned_data.get("has_guest"): fellowships = fellowships.exclude(status=Fellowship.STATUS_GUEST) if not self.cleaned_data.get("show_expired"): - fellowships = fellowships.filter(until_date__gte=timezone.now()) + fellowships = fellowships.exclude(until_date__lt=date.today()) # Ordering of nominations # Only order if both fields are set diff --git a/scipost_django/colleges/views/fellowships_monitor.py b/scipost_django/colleges/views/fellowships_monitor.py index 4145c71c9139cf7e206d995f0a3cf25fa5f4874b..f400d30f6798cff7eb2f3feb0d0b2d88a0c81996 100644 --- a/scipost_django/colleges/views/fellowships_monitor.py +++ b/scipost_django/colleges/views/fellowships_monitor.py @@ -54,7 +54,14 @@ def _hx_search_form(request, filter_set: str): ) if filter_set == "empty": - form.apply_filter_set({}, none_on_empty=True) + form.apply_filter_set( + { + "has_regular": True, + "has_senior": True, + "has_guest": True, + }, + none_on_empty=True, + ) elif m := re.match(f"^from_({DATE_REGEX})_to_({DATE_REGEX})$", filter_set): date_from = date.fromisoformat(m.group(1)) date_to = date.fromisoformat(m.group(2))