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 e53d923
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion backend/src/openarchiefbeheer/accounts/managers.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import psycopg2.errors
from django.contrib.auth.models import BaseUserManager, Group, Permission
from django.contrib.postgres.aggregates import ArrayAgg
from django.db.models import Prefetch, Q, QuerySet
Expand All @@ -8,7 +9,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:
# 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 e53d923

Please sign in to comment.