quassel: Fix unable to disable application without choosing a domain name

Closes #1700

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Veiko Aasa 2020-02-26 11:47:08 +02:00 committed by James Valleroy
parent 53bf6e28a6
commit 0c1591324d
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808
2 changed files with 4 additions and 1 deletions

View File

@ -24,4 +24,5 @@ class QuasselForm(AppForm):
help_text=_(
'Select a domain to use TLS with. If the list is empty, please '
'configure at least one domain with certificates.'),
required=False,
)

View File

@ -20,7 +20,9 @@ class QuasselAppView(AppView):
def form_valid(self, form):
"""Change the access control of Radicale service."""
data = form.cleaned_data
if quassel.get_domain() != data['domain']:
app_disable = form.initial['is_enabled'] and not data['is_enabled']
if not app_disable and quassel.get_domain() != data['domain']:
quassel.set_domain(data['domain'])
quassel.app.get_component(
'letsencrypt-quassel').setup_certificates()