Have a model that is change-logged (implements to_objectchange or inherits from ChangeLoggedModel) but has no associated REST API serializer
Create, update, or delete an instance of this model.
Expected Behavior
Change logging to succeed.
Observed Behavior
...
File "/source/nautobot/extras/signals.py", line 72, in _handle_changed_object
objectchange = instance.to_objectchange(action)
File "/source/nautobot/extras/models/change_logging.py", line 43, in to_objectchange
object_data_v2=serialize_object_v2(self),
File "/source/nautobot/utilities/utils.py", line 152, in serialize_object_v2
serializer_class = get_serializer_for_model(obj.__class__)
File "/source/nautobot/utilities/api.py", line 29, in get_serializer_for_model
"Could not determine serializer for {}.{} with prefix '{}'".format(app_name, model_name, prefix)
nautobot.core.api.exceptions.SerializerNotFound: Could not determine serializer for extras.Job with prefix ''
IMHO the to_objectchange implementation needs to catch the SerializerNotFound exception, possibly log a warning message, and gracefully recover.
Environment
next
b44947ca5Steps to Reproduce
to_objectchange
or inherits fromChangeLoggedModel
) but has no associated REST API serializerExpected Behavior
Change logging to succeed.
Observed Behavior
IMHO the
to_objectchange
implementation needs to catch theSerializerNotFound
exception, possibly log a warning message, and gracefully recover.