From 13c629317a4b90fd41c5b4e705ed31dc6efd9ba2 Mon Sep 17 00:00:00 2001 From: Sven van de Scheur Date: Fri, 20 Dec 2024 14:01:21 +0100 Subject: [PATCH] :green_heart: #554 - chore: fix broken CI check possibly due to missing permissions --- backend/src/openarchiefbeheer/accounts/managers.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/src/openarchiefbeheer/accounts/managers.py b/backend/src/openarchiefbeheer/accounts/managers.py index 61d31541..990ed85c 100644 --- a/backend/src/openarchiefbeheer/accounts/managers.py +++ b/backend/src/openarchiefbeheer/accounts/managers.py @@ -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":