Skip to content

Conversation

@ELDiablO59152
Copy link
Member

Fixed

  • [SYSTEM] [PKI] Broken form

@ELDiablO59152 ELDiablO59152 requested a review from frikilax June 13, 2025 13:16
@ELDiablO59152 ELDiablO59152 self-assigned this Jun 13, 2025
@ELDiablO59152 ELDiablO59152 added the bug Something isn't working label Jun 13, 2025
@ELDiablO59152 ELDiablO59152 force-pushed the fix_broken_x509_form branch from 583b07b to a0a8891 Compare June 24, 2025 16:24
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,
Copy link
Member

Choose a reason for hiding this comment

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

no change

Comment on lines +71 to +72
if cleaned_data.get('type') == "internal" and not cleaned_data.get('cn'):
self.add_error('cn', "This field is required if 'type' is 'internal'")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested 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'")
if cleaned_data.get('type') != "external" and not cleaned_data.get('cn'):
self.add_error('cn', "This field is required")

Comment on lines +146 to +150
CERTIFICATE_TYPE_CHOICES = (
('internal', "Self-Signed Vulture Certificate"),
('letsencrypt', "Let's Encrypt Certificate"),
('external', "External certificate")
)
Copy link
Member

Choose a reason for hiding this comment

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

Prefer using enumeration types

@frikilax
Copy link
Member

When saving an "external certificate", the form cannot be validated and no errors are shown (presumably the cn variable is required but hidden)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants