Fixes #7082: Avoid exception when referencing invalid content type in table

This commit is contained in:
jeremystretch
2021-08-31 11:43:44 -04:00
parent 6ddf1313c8
commit 37c4a3963e
2 changed files with 5 additions and 0 deletions

View File

@@ -237,9 +237,13 @@ class ContentTypeColumn(tables.Column):
Display a ContentType instance.
"""
def render(self, value):
if value is None:
return None
return content_type_name(value)
def value(self, value):
if value is None:
return None
return f"{value.app_label}.{value.model}"