mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-27 10:58:37 -06:00
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.
This commit is contained in:
parent
45754798e7
commit
8af41a65cc
@ -125,7 +125,7 @@ class Command(BaseCommand):
|
||||
job = Job.objects.create(
|
||||
object=module,
|
||||
name=script.class_name,
|
||||
user=User.objects.filter(is_superuser=True).order_by('pk')[0],
|
||||
user=user,
|
||||
job_id=uuid.uuid4()
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user