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):
site_url = forms.CharField(label=_("Site URL"), widget=SpanWidget(), required=False)
target_server = forms.CharField(required=False, widget=forms.HiddenInput())
class Meta:
exclude = ('database',)

View file

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

View file

@ -25,7 +25,6 @@ class PluginForm(forms.ModelForm):
class PluginDataForm(PluginForm):
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):
super().__init__(*args, **kwargs)
@ -100,6 +99,8 @@ class ExtendedPluginDataForm(PluginDataForm):
widget=forms.PasswordInput,
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):
super(ExtendedPluginDataForm, self).__init__(*args, **kwargs)
self.fields['sftpuser'].widget = forms.HiddenInput()