Skip to content
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

Fixes: #14839 - Check for tunnel termination type in data and instance in addition to intially passed data. #14995

Merged
merged 2 commits into from
Feb 5, 2024

Conversation

DanSheps
Copy link
Member

Fixes: #14839

  • Check for tunnel termination type in the form data and instance in addition to intially passed data.

Comment on lines 269 to 275
if (
initial and initial.get('type') == TunnelTerminationTypeChoices.TYPE_VIRTUALMACHINE
) or (
self.data and self.data.get('type') == TunnelTerminationTypeChoices.TYPE_VIRTUALMACHINE
) or (
self.instance.pk and isinstance(self.instance.termination.parent_object, VirtualMachine)
):
Copy link
Member

Choose a reason for hiding this comment

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

Run-on conditionals like this are not viable from a maintainability standpoint. Please have a look at how we've used the get_field_value() utility function in other forms to avoid this.

@jeremystretch jeremystretch merged commit 1a9149d into develop Feb 5, 2024
8 checks passed
@jeremystretch jeremystretch deleted the 14839-fix-vm-vpn-tunnel-termination branch February 5, 2024 14:59
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 7, 2024
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.

Unable to create tunnel termination for virtual machine
2 participants