1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Fix returning default for unknown userconfig key

This commit is contained in:
Jeremy Stretch
2020-04-24 10:37:02 -04:00
parent 587339bea0
commit dc9617c7aa
2 changed files with 7 additions and 1 deletions

View File

@@ -49,7 +49,7 @@ class UserConfig(models.Model):
# Iterate down the hierarchy, returning the default value if any invalid key is encountered
for key in keys:
if type(d) is dict:
if type(d) is dict and key in d:
d = d.get(key)
else:
return default