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

14637 update to Django 5 (#14675)

* 14637 update to Django 5

* 14637 fix tests

* 14637 remove extra assignment

* Syntax tweak

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
This commit is contained in:
Arthur Hanson
2024-01-05 10:30:04 -08:00
committed by GitHub
parent 8e20581da7
commit 58227293f3
6 changed files with 11 additions and 9 deletions

View File

@@ -182,7 +182,7 @@ class ConfigContextModel(models.Model):
if not hasattr(self, 'config_context_data'):
# The annotation is not available, so we fall back to manually querying for the config context objects
config_context_data = ConfigContext.objects.get_for_object(self, aggregate_data=True)
config_context_data = ConfigContext.objects.get_for_object(self, aggregate_data=True) or []
else:
# The attribute may exist, but the annotated value could be None if there is no config context data
config_context_data = self.config_context_data or []