mirror of
https://github.com/netbox-community/netbox.git
synced 2026-02-05 14:56:24 -06:00
* Replace masonry with gridstack * Initial work on dashboard widgets * Implement function to save dashboard layout * Define a default dashboard * Clean up widgets * Implement widget configuration views & forms * Permit merging dict value with existing dict in user config * Add widget deletion view * Enable HTMX for widget configuration * Implement view to add dashboard widgets * ObjectCountsWidget: Identify models by app_label & name * Add color customization to dashboard widgets * Introduce Dashboard model to store user dashboard layout & config * Clean up utility functions * Remove hard-coded API URL * Use fixed grid cell height * Add modal close button * Clean up dashboard views * Rebuild JS
This commit is contained in:
@@ -140,7 +140,10 @@ class UserConfig(models.Model):
|
||||
# Set a key based on the last item in the path. Raise TypeError if attempting to overwrite a non-leaf node.
|
||||
key = keys[-1]
|
||||
if key in d and type(d[key]) is dict:
|
||||
raise TypeError(f"Key '{path}' has child keys; cannot assign a value")
|
||||
if type(value) is dict:
|
||||
d[key].update(value)
|
||||
else:
|
||||
raise TypeError(f"Key '{path}' is a dictionary; cannot assign a non-dictionary value")
|
||||
else:
|
||||
d[key] = value
|
||||
|
||||
|
||||
Reference in New Issue
Block a user