Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
jnussbaum committed Mar 28, 2024
1 parent 3264669 commit 8f73476
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions dsp_permissions_scripts/models/scope.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 8f73476

Please sign in to comment.