fix error with Location.get_child() in editor
This commit is contained in:
parent
5a034dc1fa
commit
38edfe4216
2 changed files with 3 additions and 3 deletions
|
@ -46,10 +46,10 @@ class LocationSlug(SerializableMixin, models.Model):
|
|||
|
||||
objects = LocationSlugManager()
|
||||
|
||||
def get_child(self):
|
||||
def get_child(self, instance=None):
|
||||
for model in get_submodels(Location)+[LocationRedirect]:
|
||||
with suppress(AttributeError):
|
||||
return getattr(self, model._meta.default_related_name)
|
||||
return getattr(instance or self, model._meta.default_related_name)
|
||||
return None
|
||||
|
||||
def get_slug(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue