Remove results query from extras/views.py under ScriptView.get() #8989

Closed
opened 2025-12-29 20:43:54 +01:00 by adam · 0 comments
Owner

Originally created by @DanSheps on GitHub (Dec 20, 2023).

Originally assigned to: @DanSheps on GitHub.

Proposed Changes

Remove:

        # Look for a pending Job (use the latest one by creation timestamp)
        object_type = ContentType.objects.get(app_label='extras', model='scriptmodule')
        script.result = Job.objects.filter(
            object_type=object_type,
            object_id=module.pk,
            name=script.class_name,
        ).exclude(
            status__in=JobStatusChoices.TERMINAL_STATE_CHOICES
        ).first()

Justification

This appears to be extraneous code that was left over from when results were handled inline. This is no longer needed as the result is a separate view.

result is not referenced anywhere in the template.

Originally created by @DanSheps on GitHub (Dec 20, 2023). Originally assigned to: @DanSheps on GitHub. ### Proposed Changes Remove: ``` # Look for a pending Job (use the latest one by creation timestamp) object_type = ContentType.objects.get(app_label='extras', model='scriptmodule') script.result = Job.objects.filter( object_type=object_type, object_id=module.pk, name=script.class_name, ).exclude( status__in=JobStatusChoices.TERMINAL_STATE_CHOICES ).first() ``` ### Justification This appears to be extraneous code that was left over from when results were handled inline. This is no longer needed as the result is a separate view. `result` is not referenced anywhere in the template.
adam added the status: acceptedtype: housekeeping labels 2025-12-29 20:43:54 +01:00
adam closed this issue 2025-12-29 20:43:55 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#8989