mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 06:42:16 +00:00
Fixed form issues for service
This commit is contained in:
@@ -30,13 +30,9 @@ def UserServiceAccountForm(user):
|
|||||||
""" Generate a Service Account form based on the user's permissions """
|
""" Generate a Service Account form based on the user's permissions """
|
||||||
|
|
||||||
services = Service.objects.filter(groups__in=user.groups.all())
|
services = Service.objects.filter(groups__in=user.groups.all())
|
||||||
choices = []
|
|
||||||
|
|
||||||
for service in services.all():
|
|
||||||
choices.append( ( service.name, service ) )
|
|
||||||
|
|
||||||
class ServiceAccountForm(forms.Form):
|
class ServiceAccountForm(forms.Form):
|
||||||
service = forms.ChoiceField(choices=choices)
|
service = forms.ModelChoiceField(queryset=services)
|
||||||
username = ServiceUsernameField(min_length=4,max_length=50)
|
username = ServiceUsernameField(min_length=4,max_length=50)
|
||||||
password = forms.CharField(label = u'Password',widget = forms.PasswordInput(render_value=False))
|
password = forms.CharField(label = u'Password',widget = forms.PasswordInput(render_value=False))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user