filter servers on webalizer app, show only webservers

This commit is contained in:
Jorge Pastor 2023-12-15 10:30:20 +01:00
parent 1610c301cf
commit f7a4fc749b
1 changed files with 3 additions and 2 deletions

View File

@ -27,6 +27,7 @@ class WebalizerAppform(PluginDataForm):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(WebalizerAppform, self).__init__(*args, **kwargs) super(WebalizerAppform, self).__init__(*args, **kwargs)
self.fields['sftpuser'].widget = forms.HiddenInput() self.fields['sftpuser'].widget = forms.HiddenInput()
if self.instance.id is None:
qsServer = self.fields['target_server'].queryset.filter(name__in=WEB_SERVERS) qsServer = self.fields['target_server'].queryset.filter(name__in=WEB_SERVERS)
self.fields['target_server'].queryset = qsServer self.fields['target_server'].queryset = qsServer