Skip to content

Commit a1a3e22

Browse files
committed
Reduce code
1 parent b688b61 commit a1a3e22

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

ansible_base/resource_registry/shared_types.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,8 @@ class RoleDefinitionType(SharedResourceTypeSerializer):
107107
permissions = LenientPermissionSlugListField()
108108

109109
def is_valid(self, raise_exception=False):
110-
if not raise_exception:
111-
return super().is_valid(raise_exception=False)
112-
113110
try:
114-
return super().is_valid(raise_exception=True)
111+
return super().is_valid(raise_exception=raise_exception)
115112
except ValidationError as e:
116113
if hasattr(e, 'detail') and 'content_type' in e.detail:
117114
fd_detail = e.detail['content_type'][0]

0 commit comments

Comments
 (0)