def clean_username(self): """ Validate that the username is in use. """ user = User.gql("WHERE username = :1 ", self.cleaned_data['username']) if not user: raise forms.ValidationError(__(u'That is not a valid username.')) return self.cleaned_data['username']
def clean_username(self): """ Validate that the username is alphanumeric and is not already in use. """ q = User.all() q.filter('user ='******'username'].lower()) if q.count() > 0: raise forms.ValidationError(__(u'That Delicious account is already signed up for Delvicious. Please login or choose another.')) return self.cleaned_data['username']