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

@ -121,7 +121,7 @@ class Segment(ClusterableModel):
], heading="Segment"),
MultiFieldPanel([
InlinePanel(
"{}_related".format(rule_model._meta.db_table),
"{}s".format(rule_model._meta.db_table),
label='{}{}'.format(
rule_model._meta.verbose_name,
' ({})'.format(_('Static compatible')) if rule_model.static else ''