From f7a4fc749b011ba2af0396ed185450904caf41ce Mon Sep 17 00:00:00 2001 From: jorgepastorr Date: Fri, 15 Dec 2023 10:30:20 +0100 Subject: [PATCH] filter servers on webalizer app, show only webservers --- orchestra/contrib/webapps/types/misc.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/orchestra/contrib/webapps/types/misc.py b/orchestra/contrib/webapps/types/misc.py index bb845493..ab5900d0 100644 --- a/orchestra/contrib/webapps/types/misc.py +++ b/orchestra/contrib/webapps/types/misc.py @@ -27,8 +27,9 @@ class WebalizerAppform(PluginDataForm): def __init__(self, *args, **kwargs): super(WebalizerAppform, self).__init__(*args, **kwargs) self.fields['sftpuser'].widget = forms.HiddenInput() - qsServer = self.fields['target_server'].queryset.filter(name__in=WEB_SERVERS) - self.fields['target_server'].queryset = qsServer + if self.instance.id is None: + qsServer = self.fields['target_server'].queryset.filter(name__in=WEB_SERVERS) + self.fields['target_server'].queryset = qsServer class WebalizerApp(AppType): name = 'webalizer'