def clean_username(self): username = self.cleaned_data['username'] users = User.gql("WHERE username='******'" % username.lower()) if users.count() == 0: raise forms.ValidationError(_('This Username is not exist')) return users
def clean_destination(self): destination = self.cleaned_data['destination'] if User.gql("WHERE username='******'" % destination).count() > 0: return destination else: raise forms.ValidationError(_('This Username is not exist'))
def clean_username(self): username = self.cleaned_data['username'] if User.gql("WHERE username='******'" % username.lower()).count() > 0: raise forms.ValidationError(_('A user with that username already exists.')) return username.lower()