mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-03-11 09:04:54 +00:00
Closes #1700 Signed-off-by: Veiko Aasa <veiko17@disroot.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
31 lines
942 B
Python
31 lines
942 B
Python
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
from plinth.modules import quassel
|
|
from plinth.views import AppView
|
|
|
|
from .forms import QuasselForm
|
|
|
|
|
|
class QuasselAppView(AppView):
|
|
app_id = 'quassel'
|
|
port_forwarding_info = quassel.port_forwarding_info
|
|
form_class = QuasselForm
|
|
|
|
def get_initial(self):
|
|
"""Return the values to fill in the form."""
|
|
initial = super().get_initial()
|
|
initial['domain'] = quassel.get_domain()
|
|
return initial
|
|
|
|
def form_valid(self, form):
|
|
"""Change the access control of Radicale service."""
|
|
data = form.cleaned_data
|
|
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()
|
|
|
|
return super().form_valid(form)
|