diff --git a/netbox/core/models/jobs.py b/netbox/core/models/jobs.py index 822d9b20116..1d0e7fdebcc 100644 --- a/netbox/core/models/jobs.py +++ b/netbox/core/models/jobs.py @@ -221,7 +221,7 @@ def enqueue(cls, func, instance=None, name='', user=None, schedule_at=None, inte object_id = instance.pk else: object_type = object_id = None - rq_queue_name = get_queue_for_model(object_type.model) + rq_queue_name = get_queue_for_model(object_type.model if object_type else None) queue = django_rq.get_queue(rq_queue_name) status = JobStatusChoices.STATUS_SCHEDULED if schedule_at else JobStatusChoices.STATUS_PENDING job = Job.objects.create(