-
Notifications
You must be signed in to change notification settings - Fork 10
fix(system) : broken pki form #576
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
base: dev
Are you sure you want to change the base?
Conversation
583b07b to
a0a8891
Compare
| from system.pki.models import (ALPN_CHOICES, BROWSER_CHOICES, PROTOCOL_CHOICES, TLSProfile, X509Certificate, | ||
| VERIFY_CHOICES) | ||
| CharField, ChoiceField) | ||
| from system.pki.models import (TLSProfile, X509Certificate, ALPN_CHOICES, BROWSER_CHOICES, PROTOCOL_CHOICES, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no change
| if cleaned_data.get('type') == "internal" and not cleaned_data.get('cn'): | ||
| self.add_error('cn', "This field is required if 'type' is 'internal'") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if cleaned_data.get('type') == "internal" and not cleaned_data.get('cn'): | |
| self.add_error('cn', "This field is required if 'type' is 'internal'") | |
| if cleaned_data.get('type') != "external" and not cleaned_data.get('cn'): | |
| self.add_error('cn', "This field is required") |
| CERTIFICATE_TYPE_CHOICES = ( | ||
| ('internal', "Self-Signed Vulture Certificate"), | ||
| ('letsencrypt', "Let's Encrypt Certificate"), | ||
| ('external', "External certificate") | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer using enumeration types
|
When saving an "external certificate", the form cannot be validated and no errors are shown (presumably the |
Fixed