Skip to content

Commit

Permalink
💚 #554 - chore: fix broken CI check possibly due to missing permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
svenvandescheur committed Dec 20, 2024
1 parent 55f61ec commit 13c6293
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion backend/src/openarchiefbeheer/accounts/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ def record_managers(self) -> "UserQuerySet":
"""
Returns a QuerySet of users that have the permission to start a destruction list.
"""
permission = Permission.objects.get(codename="can_start_destruction")
try:
permission = Permission.objects.get(codename="can_start_destruction")
except Permission.DoesNotExist:
# Rare occasion where permissions are not yet migrated?
return self.none()
return self._users_with_permission(permission)

def reviewers(self) -> "UserQuerySet":
Expand Down

0 comments on commit 13c6293

Please sign in to comment.