Fix bug on visiting a segment page in the admin
Wagtail's InlinePanel's relies on
django.db.models.options.Options.get_field -
bcf6b6da77/wagtail/admin/edit_handlers.py (L688)
which seems to have a bug of using related_query_name rather than
related_name naming and therefore trying to edit segment always
fails - https://code.djangoproject.com/ticket/29458. The bug has not
yet been confirmed by others but it's impossible to edit segments.
Therefore this change deletes related_query_name from relations from
rules to the Segment model.
This commit is contained in:
@ -29,8 +29,7 @@ class AbstractBaseRule(models.Model):
|
||||
|
||||
segment = ParentalKey(
|
||||
'wagtail_personalisation.Segment',
|
||||
related_name="%(app_label)s_%(class)s_related",
|
||||
related_query_name="%(app_label)s_%(class)ss"
|
||||
related_name="%(app_label)s_%(class)ss",
|
||||
)
|
||||
|
||||
class Meta:
|
||||
|
Reference in New Issue
Block a user