From 87ee95553156b35ff5f26985be19e4cca290dd0e Mon Sep 17 00:00:00 2001 From: jorgepastorr Date: Tue, 5 Sep 2023 12:27:45 +0200 Subject: [PATCH] fix problem with sftpuser onnSAslist and webalizer --- orchestra/contrib/webapps/types/misc.py | 8 +++++++- orchestra/plugins/forms.py | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/orchestra/contrib/webapps/types/misc.py b/orchestra/contrib/webapps/types/misc.py index d80a66b8..98a0aae7 100644 --- a/orchestra/contrib/webapps/types/misc.py +++ b/orchestra/contrib/webapps/types/misc.py @@ -23,6 +23,11 @@ class StaticApp(AppType): return ('static', self.instance.get_path()) +class WebalizerAppform(PluginDataForm): + def __init__(self, *args, **kwargs): + super(WebalizerAppform, self).__init__(*args, **kwargs) + self.fields['sftpuser'].widget = forms.HiddenInput() + class WebalizerApp(AppType): name = 'webalizer' verbose_name = "Webalizer" @@ -32,7 +37,8 @@ class WebalizerApp(AppType): "Statistics will be collected once this app is mounted into one or more Websites.") icon = 'orchestra/icons/apps/Stats.png' option_groups = () - form = PluginDataForm + # form = PluginDataForm + form = WebalizerAppform def get_directive(self): webalizer_path = os.path.join(self.instance.get_path(), '%(site_name)s') diff --git a/orchestra/plugins/forms.py b/orchestra/plugins/forms.py index cbd71489..14f55877 100644 --- a/orchestra/plugins/forms.py +++ b/orchestra/plugins/forms.py @@ -29,7 +29,6 @@ class PluginDataForm(PluginForm): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) - self.fields['sftpuser'].widget = forms.HiddenInput() if self.instance: for field in self.declared_fields: initial = self.fields[field].initial @@ -103,6 +102,7 @@ class ExtendedPluginDataForm(PluginDataForm): def __init__(self, *args, **kwargs): super(ExtendedPluginDataForm, self).__init__(*args, **kwargs) + self.fields['sftpuser'].widget = forms.HiddenInput() if self.instance.id is not None: self.fields['username'].widget = forms.HiddenInput() self.fields['password1'].widget = forms.HiddenInput()