Example #1
0
	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
Example #2
0
	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'))
Example #3
0
	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()