Example #1
0
 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))
Example #2
0
 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))
Example #3
0
 def is_client(self, obj):
     return check_client(obj)