-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When a background job is scheduled without an instance, delete() on the job model will throw exceptions #17648
Comments
I believe this is because rq_queue_name = get_config().QUEUE_MAPPINGS.get(self.object_type.model, RQ_QUEUE_DEFAULT) In rq_queue_name = get_queue_for_model(object_type.model if object_type else None) I suggest using the same lookup in both instances and add to add a test checking jobs actually can be deleted. If this is accepted, I volunteer for a PR. |
Yup, I knew the problem, but thanks for pointing out the |
It seems that deleting jobs is already covered by a test case ( |
…_type specified (#17657) * Fixes: #17648 - Fix exception thrown in `Job.delete()` when no object_type specified * Remove unrelated fix * Change back elif to if * Remove unused imports --------- Co-authored-by: Jeremy Stretch <[email protected]>
…_type specified (#17657) * Fixes: #17648 - Fix exception thrown in `Job.delete()` when no object_type specified * Remove unrelated fix * Change back elif to if * Remove unused imports --------- Co-authored-by: Jeremy Stretch <[email protected]>
…` when no object_type specified (netbox-community#17657) * Fixes: netbox-community#17648 - Fix exception thrown in `Job.delete()` when no object_type specified * Remove unrelated fix * Change back elif to if * Remove unused imports --------- Co-authored-by: Jeremy Stretch <[email protected]>
Deployment Type
Self-hosted
NetBox Version
v4.1.2
Python Version
3.12
Steps to Reproduce
Expected Behavior
NetBox will function normally
Observed Behavior
AttributeError is raised in
Job.delete()
The text was updated successfully, but these errors were encountered: