From 8f73476d7a00ba7f1bca6b14bcfe1acd042fa7fe Mon Sep 17 00:00:00 2001 From: Johannes Nussbaum Date: Thu, 28 Mar 2024 11:11:37 +0100 Subject: [PATCH] simplify --- dsp_permissions_scripts/models/scope.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dsp_permissions_scripts/models/scope.py b/dsp_permissions_scripts/models/scope.py index 29fc4fc7..496d0d0f 100644 --- a/dsp_permissions_scripts/models/scope.py +++ b/dsp_permissions_scripts/models/scope.py @@ -43,8 +43,7 @@ def from_dict(d: dict[str, list[str]]) -> PermissionScope: def check_group_occurs_only_once(self) -> PermissionScope: all_groups = [] for field in self.model_fields: - groups = self.get(field) - all_groups.extend([g.val for g in groups]) + all_groups.extend([g.val for g in self.get(field)]) for group in all_groups: if all_groups.count(group) > 1: raise ValueError(f"Group {group} must not occur in more than one field")