Skip to content

Fixes RelatedObjectDoesNotExist #12368

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

Merged
merged 1 commit into from
May 2, 2023
Merged

Fixes RelatedObjectDoesNotExist #12368

merged 1 commit into from
May 2, 2023

Conversation

abhi1693
Copy link
Member

Fixes: #12367

@abhi1693 abhi1693 requested a review from jeremystretch April 27, 2023 16:54
Copy link
Collaborator

@arthanson arthanson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jeremystretch Looking at this I think the fix is fine, but edge-case - If I'm reading the flow correctly the form doesn't have a form field referencing HardwareNotice object, and only sets it if validation passes - however super().clean() is called at start and I think this will cause a model-clean which will cause the NetBoxModel clean to be run which will error as these fields are blank.

I can't think of any negative effect from this change, but edge-case that I think most people wouldn't run into. I think the plugin code could also be re-factored to set object before calling the super.clean

@jeremystretch jeremystretch merged commit a566a56 into develop May 2, 2023
@jeremystretch jeremystretch deleted the fix/12367-gfk branch May 2, 2023 13:48
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RelatedObjectDoesNotExist is raised when the form contains options to set multiple objects
3 participants