skip deferred fields
in locationgroup init to prevent infinite recursion
This commit is contained in:
parent
cbf3479a13
commit
4a37e63a2d
1 changed files with 5 additions and 4 deletions
|
@ -354,13 +354,14 @@ class LocationGroup(Location, models.Model):
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
|
deferred_fields = self.get_deferred_fields()
|
||||||
self._orig = {
|
self._orig = {
|
||||||
"priority": self.priority,
|
key: getattr(self, key)
|
||||||
"hierarchy": self.hierarchy,
|
for key in ["priority", "hierarchy", "category", "color"]
|
||||||
"category_id": self.category_id,
|
if key not in deferred_fields
|
||||||
"color": self.color,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
locations = []
|
locations = []
|
||||||
|
|
||||||
def details_display(self, editor_url=True, **kwargs):
|
def details_display(self, editor_url=True, **kwargs):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue