You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for filing the issue! We actually just noticed this bug yesterday on the core team. :-)
The issue is in the _handle_deleted_object signal, which is being triggered when the user logs out and their session DB record gets deleted. This signal is missing logic to handle the case where the deleted object has a PK that isn't of type UUID. A first pass fix is something like:
diff --git a/nautobot/extras/signals.py b/nautobot/extras/signals.py
index 86ad2aca8..17a31217c 100644
--- a/nautobot/extras/signals.py+++ b/nautobot/extras/signals.py@@ -20,6 +20,7 @@ from django_prometheus.models import model_deletes, model_inserts, model_updates
from nautobot.core.celery import app, import_jobs_as_celery_tasks
from nautobot.core.utils.config import get_settings_or_config
+from nautobot.core.utils.data import is_uuid
from nautobot.extras.choices import JobResultStatusChoices, ObjectChangeActionChoices
from nautobot.extras.constants import CHANGELOG_MAX_CHANGE_CONTEXT_DETAIL
from nautobot.extras.models import (
@@ -165,6 +166,10 @@ def _handle_deleted_object(sender, instance, **kwargs):
if change_context_state.get() is None:
return
+ if not is_uuid(instance.pk):+ # Probably some system object+ return+
associations = ContactAssociation.objects.filter(
associated_object_type=ContentType.objects.get_for_model(type(instance)), associated_object_id=instance.pk
)
but we're having some discussions about whether there may be a more elegant way to fix it.
Environment
This is applicable when using the
next
branch with versionv2.2.0a1
.Steps to Reproduce
Expected Behavior
Logout successfully
Observed Behavior
A
ValidationError
is thrown at/logout/
with message['“4ci8je1rmskkfei3g8avd9mt2da2bft5” is not a valid UUID.']
when I use thenext
branch.The text was updated successfully, but these errors were encountered: