Skip to content

Commit 8d0dca0

Browse files
author
James Chapman
committed
Guarded the allOf attribute lookup in resources.py using Python's hasattr built-in function:
if hasattr(resource_template, "allOf") and resource_template.allOf is not None:
1 parent 4eca9fe commit 8d0dca0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

api_app/db/repositories/resources.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ async def validate_input_against_template(self, template_name: str, resource_inp
113113

114114
def _get_all_property_keys_from_template(self, resource_template: ResourceTemplate) -> set:
115115
properties = set(resource_template.properties.keys())
116-
if resource_template.allOf is not None:
116+
if hasattr(resource_template, "allOf") and resource_template.allOf is not None:
117117
for condition in resource_template.allOf:
118118
if "then" in condition and "properties" in condition["then"]:
119119
properties.update(condition["then"]["properties"].keys())

0 commit comments

Comments
 (0)