parameters: (self)
return_statement: return None
docstring: Returns a string with any validation errors,
          or None if the profile is valid.
docstring_summary: Returns a string with any validation errors,
          or None if the profile is valid.
docstring_tokens: Returns a string with any validation errors or None if the profile is valid .
function: def errors(self):
          """
          Returns a string with any validation errors,
          or None if the profile is valid.
          """
          # Slug
          if re.search(r"[^a-z0-9\-]", self.slug):
              return "Profile URLs may only contain lowercase letters, numbers and hyphens."
  
          existing = db.profiles.find_one({"slug": self.slug, "_id": {"$ne": self._id}})
          if existing:
              return "The Profile URL you have requested is already in use."
          # URL Fields: website, facebook, linkedin
          url_val = URLValidator()
          try:
              if self.facebook: url_val(self.facebook)
          except ValidationError as e:
              return "The Facebook URL you entered is not valid."
          try:
              if self.linkedin: url_val(self.linkedin)
          except ValidationError as e:
              return "The LinkedIn URL you entered is not valid."
          try:
              if self.website: url_val(self.website)
          except ValidationError as e:
              return "The Website URL you entered is not valid."
          email_val = EmailValidator()
          try:
              if self.email: email_val(self.email)
          except ValidationError as e:
              return "The email address you entered is not valid."
  
          return None
function_tokens: def errors ( self ) : # Slug if re . search ( r"[^a-z0-9\-]" , self . slug ) : return "Profile URLs may only contain lowercase letters, numbers and hyphens." existing = db . profiles . find_one ( { "slug" : self . slug , "_id" : { "$ne" : self . _id } } ) if existing : return "The Profile URL you have requested is already in use." # URL Fields: website, facebook, linkedin url_val = URLValidator ( ) try : if self . facebook : url_val ( self . facebook ) except ValidationError as e : return "The Facebook URL you entered is not valid." try : if self . linkedin : url_val ( self . linkedin ) except ValidationError as e : return "The LinkedIn URL you entered is not valid." try : if self . website : url_val ( self . website ) except ValidationError as e : return "The Website URL you entered is not valid." email_val = EmailValidator ( ) try : if self . email : email_val ( self . email ) except ValidationError as e : return "The email address you entered is not valid." return None