Comments (2)
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.
from nautobot.
Fixed by #5322.
from nautobot.
Related Issues (20)
- A long running custom field cleanup task will fail HOT 1
- Misleading error messages when assigning choices while creating a MetadataType that fails HOT 1
- Update ModuleType yaml/json import to translate comments field
- Column role is missing under device -> interfaces (and the configure button does nothing) HOT 1
- Installed Apps Page - Provide Link to the Static Files for Docs HOT 1
- Update GitHub Templates - Plugin -> Apps
- API endpoint `prefix-location-assignments` not able to filter by prefix UUID HOT 1
- Test fixture JSON file should be named/identified by the hash of database migrations
- Make unittest `--cache-test-fixtures` and `--keepdb` arguments default-true
- Enforce that any specified `scoped_fields` actually exist on the given associated_object as a part the validation process for `ObjectMetadata` instances
- Dynamic Groups support OR filtering for Tags HOT 2
- Investigate edge case in ObjectMetadata clean() method.
- Enhance generic filter tests to include negative tests
- Consolidate list view bulk action buttons
- Consolidate list view standard action buttons
- Consolidate detail view standard action buttons
- Cloud Service Model
- Basic celery worker status page HOT 1
- Update docs about Ubuntu 24.04 and Nautobot 2.2
- Applying a Tag to a Dynamic Group doesn't work HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nautobot.