Skip to content

Commit

Permalink
Ran black
Browse files Browse the repository at this point in the history
  • Loading branch information
lakridserne committed May 26, 2024
1 parent cb7ee86 commit fe5ec15
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions members/admin/emailitem_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,16 @@ class EmailItemAdmin(admin.ModelAdmin):
)
readonly_fields = ("created_dtm", "send_error", "sent_dtm")


def get_queryset(self, request):
qs = super(EmailItemAdmin, self).get_queryset(request)
if request.user.is_superuser or request.user.has_perm(
"members.view_all_departments"
):
return qs
departments = Department.objects.filter(adminuserinformation__user=request.user)
return qs.filter(department__in=departments) | qs.filter(activity__department__in=departments)

return qs.filter(department__in=departments) | qs.filter(
activity__department__in=departments
)

fieldsets = [
(
Expand Down

0 comments on commit fe5ec15

Please sign in to comment.