mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +00:00
names: Create a generic TLS domain selection form
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
1 parent
5c62fc7599
commit
a912c867c8
5 files changed
+32
-37
No files matched your search
@@ -39,6 +39,24 @@ class DomainSelectionForm(forms.Form):
|
||||
'changed later.'), choices=[])
|
||||
|
||||
|
||||
class TLSDomainForm(forms.Form):
|
||||
"""Form to select a TLS domain for an app."""
|
||||
|
||||
def get_domain_choices():
|
||||
"""Double domain entries for inclusion in the choice field."""
|
||||
from plinth.modules.names import get_available_tls_domains
|
||||
return ((domain, domain) for domain in get_available_tls_domains())
|
||||
|
||||
domain = forms.ChoiceField(
|
||||
choices=get_domain_choices(),
|
||||
label=_('TLS domain'),
|
||||
help_text=_(
|
||||
'Select a domain to use TLS with. If the list is empty, please '
|
||||
'configure at least one domain with certificates.'),
|
||||
required=False,
|
||||
)
|
||||
|
||||
|
||||
class LanguageSelectionFormMixin:
|
||||
"""Form mixin for selecting the user's preferred language."""
|
||||
|
||||
|
||||
Reference in new issue
Block a user