fix last nyapa with target_server on SAS

This commit is contained in:
jorgepastorr 2023-09-14 10:44:02 +02:00
parent a8808366e1
commit 3ddd25b456
3 changed files with 2 additions and 3 deletions

View File

@ -12,7 +12,6 @@ from orchestra.utils.python import random_ascii
class SaaSBaseForm(PluginDataForm): class SaaSBaseForm(PluginDataForm):
site_url = forms.CharField(label=_("Site URL"), widget=SpanWidget(), required=False) site_url = forms.CharField(label=_("Site URL"), widget=SpanWidget(), required=False)
target_server = forms.CharField(required=False, widget=forms.HiddenInput())
class Meta: class Meta:
exclude = ('database',) exclude = ('database',)

View File

@ -700,7 +700,6 @@ class UNIXUserControllerNewServers(ServiceController):
def get_groups(self, user): def get_groups(self, user):
groups = [] groups = []
if user.is_main: if user.is_main:
groups = list(user.account.systemusers.exclude(username=user.username).values_list('username', flat=True))
groups.append("main-systemusers") groups.append("main-systemusers")
return groups return groups

View File

@ -25,7 +25,6 @@ class PluginForm(forms.ModelForm):
class PluginDataForm(PluginForm): class PluginDataForm(PluginForm):
data = forms.CharField(widget=forms.HiddenInput, required=False) data = forms.CharField(widget=forms.HiddenInput, required=False)
target_server = forms.ModelChoiceField(queryset=Server.objects.filter(name__in=WEB_SERVERS),)
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs) super().__init__(*args, **kwargs)
@ -100,6 +99,8 @@ class ExtendedPluginDataForm(PluginDataForm):
widget=forms.PasswordInput, widget=forms.PasswordInput,
help_text=_("Enter the same password as above, for verification.")) help_text=_("Enter the same password as above, for verification."))
target_server = forms.ModelChoiceField(queryset=Server.objects.filter(name__in=WEB_SERVERS),)
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(ExtendedPluginDataForm, self).__init__(*args, **kwargs) super(ExtendedPluginDataForm, self).__init__(*args, **kwargs)
self.fields['sftpuser'].widget = forms.HiddenInput() self.fields['sftpuser'].widget = forms.HiddenInput()