mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 14:52:15 +00:00
Removed excess clean function
This commit is contained in:
10
sso/forms.py
10
sso/forms.py
@@ -37,16 +37,6 @@ def UserServiceAccountForm(user):
|
||||
character = forms.ChoiceField(chars)
|
||||
service = forms.ChoiceField(services)
|
||||
|
||||
def clean_username(self):
|
||||
field = self.cleaned_data.get('username', '')
|
||||
|
||||
# Checks that usernames consist of letters and numbers only
|
||||
if not re.match("^[A-Za-z0-9_-]*$", field):
|
||||
raise forms.ValidationError("Invalid character in username, use letters and numbers only")
|
||||
|
||||
return field
|
||||
|
||||
|
||||
def clean(self):
|
||||
if not self.cleaned_data['character'].corporation.group in self.cleaned_data['service'].groups.all():
|
||||
raise form.ValidationError("%s is not in a corporation allowed to access %s" % (self.cleaned_data['character'].name, self.cleaned_data['service'])
|
||||
|
||||
Reference in New Issue
Block a user