Skip to content

Commit b2bbdbf

Browse files
XioNoXjeremystretch
authored andcommitted
runscript: use the previously defined "user"
There is already a logic set earlier in the code to define "user" if --user is passed as parameter, and default to the user with the lowest ID no none is provided. This patch uses this "user" to run the job instead of always applying the default.
1 parent 4fead1c commit b2bbdbf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

netbox/extras/management/commands/runscript.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def _run_script():
125125
job = Job.objects.create(
126126
object=module,
127127
name=script.class_name,
128-
user=User.objects.filter(is_superuser=True).order_by('pk')[0],
128+
user=user,
129129
job_id=uuid.uuid4()
130130
)
131131

0 commit comments

Comments
 (0)