paperwork: Fix department_certifications shop lead check
Some checks failed
Ruff / ruff (push) Successful in 29s
Test / test (push) Failing after 5m54s

parentheses are important! Also removed the superuser override, as
that was hiding the issue for my account
This commit is contained in:
Adam Goldsmith 2024-03-13 17:16:32 -04:00
parent 5aadcccb2c
commit aef53b1828

View File

@ -57,11 +57,7 @@ class MemberCertificationListView(ListView):
@login_required @login_required
def department_certifications(request): def department_certifications(request):
if request.user.is_superuser: if (member := Member.from_user(request.user)) is not None:
departments = Department.objects.prefetch_related(
"shop_lead_flag__members"
).all()
elif member := Member.from_user(request.user) is not None:
departments = Department.objects.filter_by_shop_lead(member) departments = Department.objects.filter_by_shop_lead(member)
else: else:
departments = [] departments = []