Skip to content

Commit

Permalink
Format related changes
Browse files Browse the repository at this point in the history
  • Loading branch information
skinkie committed Nov 5, 2023
1 parent 736fc27 commit 656346e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions xsdata/codegen/handlers/validate_attributes_overrides.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class ValidateAttributesOverrides(RelativeHandlerInterface):

def process(self, target: Class):
restriction_attrs = []
if len([ext for ext in target.extensions if ext.tag == 'Restriction']) > 0:
if len([ext for ext in target.extensions if ext.tag == "Restriction"]) > 0:
restriction_attrs = {
attr.slug: attr for attr in target.attrs if not attr.is_attribute
}
Expand All @@ -44,15 +44,15 @@ def process(self, target: Class):
elif attr.is_prohibited:
self.remove_attribute(target, attr)

if len([ext for ext in target.extensions if ext.tag == 'Restriction']) > 0:
if len([ext for ext in target.extensions if ext.tag == "Restriction"]) > 0:
# What we want here is to check the restriction.attrs against base_attrs_map
for slug, attr in base_attrs_map.items():

Check notice on line 49 in xsdata/codegen/handlers/validate_attributes_overrides.py

View check run for this annotation

codefactor.io / CodeFactor

xsdata/codegen/handlers/validate_attributes_overrides.py#L26-L49

Complex Method
if not attr[0].is_attribute and slug not in restriction_attrs:
attr_restricted = Attr(
tag=attr[0].tag,
name=attr[0].name,
index=attr[0].index,
restrictions=Restrictions(is_restricted=True)
restrictions=Restrictions(is_restricted=True),
)
target.attrs.append(attr_restricted)

Expand Down

0 comments on commit 656346e

Please sign in to comment.