mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 14:52:15 +00:00
Added User Lookup feature
This commit is contained in:
11
sso/forms.py
11
sso/forms.py
@@ -1,4 +1,5 @@
|
||||
from django import forms
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
from eve_api.models.api_player import EVEAccount
|
||||
from sso.models import ServiceAccount, Service
|
||||
@@ -52,3 +53,13 @@ class RedditAccountForm(forms.Form):
|
||||
return self.cleaned_data
|
||||
else:
|
||||
raise forms.ValidationError("This User ID is already registered")
|
||||
|
||||
class UserLookupForm(forms.Form):
|
||||
username = forms.CharField(label = u'User ID', max_length=64)
|
||||
|
||||
def clean(self):
|
||||
try:
|
||||
acc = User.objects.get(username=self.cleaned_data['username'])
|
||||
except User.DoesNotExist:
|
||||
raise forms.ValidationError("User doesn't exist")
|
||||
return self.cleaned_data
|
||||
|
||||
Reference in New Issue
Block a user