mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-23 04:22:01 -06:00
#7082: Handle stale content types
This commit is contained in:
parent
662c896480
commit
528df76747
@ -348,8 +348,12 @@ def content_type_name(contenttype):
|
|||||||
"""
|
"""
|
||||||
Return a proper ContentType name.
|
Return a proper ContentType name.
|
||||||
"""
|
"""
|
||||||
meta = contenttype.model_class()._meta
|
try:
|
||||||
return f'{meta.app_config.verbose_name} > {meta.verbose_name}'
|
meta = contenttype.model_class()._meta
|
||||||
|
return f'{meta.app_config.verbose_name} > {meta.verbose_name}'
|
||||||
|
except AttributeError:
|
||||||
|
# Model no longer exists
|
||||||
|
return f'{contenttype.app_label} > {contenttype.model}'
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
|
Loading…
Reference in New Issue
Block a user