Skip to content

Commit

Permalink
fix(itam): When validating device config, only do so if there is conf…
Browse files Browse the repository at this point in the history
…ig defined

ref: fixes #407
  • Loading branch information
jon-nfc committed Nov 30, 2024
1 parent 1093c55 commit b160c03
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions app/itam/models/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,14 @@ class Meta:

def validate_config_keys_not_reserved(self):

value: dict = self
if self:

for invalid_key in Device.reserved_config_keys:
value: dict = self

if invalid_key in value.keys():
raise ValidationError(f'json key "{invalid_key}" is a reserved configuration key')
for invalid_key in Device.reserved_config_keys:

if invalid_key in value.keys():
raise ValidationError(f'json key "{invalid_key}" is a reserved configuration key')


def validate_uuid_format(self):
Expand Down

0 comments on commit b160c03

Please sign in to comment.