Skip to content

Commit

Permalink
Fix compatibility with pylint-django
Browse files Browse the repository at this point in the history
It's not possible to use wagtail in a project with pylint and the
pylint-django plugin.

Pylint-django does not work with foreign keys that are referenced by
their string names. See: https://github.com/PyCQA/pylint-django#known-issues

If we simply replace the string name with the foreign-key class, linting
on wagtail projects is fixed.

Also see:
pylint-dev/pylint#2995
pylint-dev/pylint-django#241
  • Loading branch information
danihodovic committed Aug 25, 2019
1 parent e263aaf commit fb01d93
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wagtail/core/models.py
Expand Up @@ -246,7 +246,7 @@ class Page(AbstractPage, index.Indexed, ClusterableModel, metaclass=PageBase):
help_text=_("The name of the page as it will appear in URLs e.g http://domain.com/blog/[my-slug]/")
)
content_type = models.ForeignKey(
'contenttypes.ContentType',
ContentType,
verbose_name=_('content type'),
related_name='pages',
on_delete=models.SET(get_default_page_content_type)
Expand Down

0 comments on commit fb01d93

Please sign in to comment.