def validate(self): for email in self.emails: if not email_re.match(email): raise CustomValidationError('{0} is not a propper email.'.format(email)) users = User.objects.filter(username__in=self.emails) for user in users: if check_client(user): raise CustomValidationError("You can't connect to {0}".format(user.username))
def validate(self): for email in self.emails: if not email_re.match(email): raise CustomValidationError( '{0} is not a propper email.'.format(email)) users = User.objects.filter(username__in=self.emails) for user in users: if check_client(user): raise CustomValidationError("You can't connect to {0}".format( user.username))
def is_client(self, obj): return check_client(obj)