7

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:
Tomasz Knapik
2018-05-30 19:51:20 +01:00
parent 65a46f2bd9
commit 7e9dd8624b
3 changed files with 52 additions and 3 deletions

View File

@ -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: