Skip to content

Commit

Permalink
Import ScriptJob directly
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremystretch committed Jul 24, 2024
1 parent 654e6e7 commit 62380fb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions netbox/extras/events.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
from collections import defaultdict

from django.conf import settings
from django.contrib.auth import get_user_model
Expand All @@ -8,9 +9,7 @@
from django.utils.translation import gettext as _
from django_rq import get_queue

from core.choices import ObjectChangeActionChoices
from core.events import *
from core.models import Job
from netbox.config import get_config
from netbox.constants import RQ_QUEUE_DEFAULT
from netbox.registry import registry
Expand Down Expand Up @@ -126,7 +125,7 @@ def process_event_rules(event_rules, object_type, event_type, data, username=Non
script = event_rule.action_object.python_class()

# Enqueue a Job to record the script's execution
ScriptJob = import_string("extras.jobs.ScriptJob")
from extras.jobs import ScriptJob
ScriptJob.enqueue(
instance=event_rule.action_object,
name=script.name,
Expand Down

0 comments on commit 62380fb

Please sign in to comment.