1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

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 7db2b9d091
commit 415313ac2f
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}"