Skip to content

Commit

Permalink
fix: filter admin field in project admin
Browse files Browse the repository at this point in the history
  • Loading branch information
wiwski committed Mar 2, 2023
1 parent 0aa5335 commit 233edd9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lab/admin/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,3 +248,11 @@ def changelist_view(
request,
{**(extra_context if extra_context else {}), "title": _("Projects")},
)

def get_field_queryset(
self, db: None, db_field, request: Optional[HttpRequest]
) -> Optional[Any]:
qs = super().get_field_queryset(db, db_field, request)
if qs and db_field == Project.admin.field:
return qs.filter(is_lab_admin=True)
return qs

0 comments on commit 233edd9

Please sign in to comment.