1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-02 23:48:47 +00:00

Remove auth and site from app, clean auth modual

This commit is contained in:
xiez
2012-04-26 20:33:24 +08:00
parent 153da6ad55
commit d14ca9a86d
12 changed files with 18 additions and 579 deletions

View File

@@ -2,6 +2,8 @@ from django import forms
from django.contrib.auth.models import User
from django.utils.translation import ugettext_lazy as _
from seaserv import ccnet_rpc
class AddUserForm(forms.Form):
"""
Form for adding a user.
@@ -12,13 +14,12 @@ class AddUserForm(forms.Form):
password2 = forms.CharField(widget=forms.PasswordInput())
def clean_email(self):
try:
user = User.objects.get(email__iexact=self.cleaned_data['email'])
except User.DoesNotExist:
email = self.cleaned_data['email']
emailuser = ccnet_rpc.get_emailuser(email)
if not emailuser:
return self.cleaned_data['email']
raise forms.ValidationError(_("A user with this email already"))
else:
raise forms.ValidationError(_("A user with this email already"))
def clean(self):
"""
Verifiy that the values entered into the two password fields