diff --git a/alyx/actions/admin.py b/alyx/actions/admin.py index 96644b18..afddf2c3 100644 --- a/alyx/actions/admin.py +++ b/alyx/actions/admin.py @@ -116,10 +116,11 @@ def lookups(self, request, model_admin): ) def queryset(self, request, queryset): + regex_string = r'^(?:[ ]*|auto-generated session)$' if self.value() == 'narrative': - return queryset.exclude(narrative__in=['', 'auto-generated session']) + return queryset.exclude(narrative__regex=regex_string) if self.value() == 'no_narrative': - return queryset.filter(narrative__in=['', 'auto-generated session']) + return queryset.filter(narrative__regex=regex_string) elif self.value is None: return queryset.all()