Ejemplo n.º 1
0
 def validate_email(self, email):
     Validator.required(email)
     Validator.length(email, 5, 40)
     user = User.query.filter_by(email=email.data).first()
     if user:
         raise ValidationError(
             f"{email.data} : Cet email est déja pris, veuillez en choisir un autre."
         )
Ejemplo n.º 2
0
 def validate_username(self, username):
     Validator.required(username)
     Validator.length(username, 6, 40)
     user = User.query.filter_by(username=username.data).first()
     if user:
         raise ValidationError(
             f"{username.data} : Ce nom d'utilisateur est déja pris, veuillez en choisir un autre."
         )
Ejemplo n.º 3
0
 def validate_diploma_year(self, diploma_year):
     Validator.required(diploma_year)
     Validator.length(diploma_year, 4, 4)
     Validator.numerical(diploma_year)
     if not (2020 >= int(str(diploma_year.data).strip()) >= 1969):
         raise ValidationError(
             'Humm... Vous êtes trop jeune ou trop agé pour travailler, non?'
         )
Ejemplo n.º 4
0
 def validate_not_key_words(self, not_key_words):
     if not_key_words.data:
         Validator.length(not_key_words, 0, 300)
         _not_key_words = not_key_words.data.split(",")
         _not_key_words = [
             i.lower().strip().replace("  ", " ").replace("-", " ").replace(
                 "  ", " ").strip() for i in _not_key_words
         ]
         _not_key_words = ", ".join(_not_key_words)
         self.not_key_words.data = not_key_words.data = _not_key_words
Ejemplo n.º 5
0
 def validate_key_words(self, key_words):
     Validator.required(key_words)
     Validator.length(key_words, 6, 300)
     _key_words = key_words.data.split(",")
     if not len(_key_words) >= 3:
         raise ValidationError('minimum 3 mots')
     _key_words = [
         i.lower().strip().replace("  ",
                                   " ").replace("-",
                                                " ").replace("  ",
                                                             " ").strip()
         for i in _key_words
     ]
     _key_words = ", ".join(_key_words)
     self.key_words.data = key_words.data = _key_words
Ejemplo n.º 6
0
 def validate_diploma_school(self, diploma_school):
     Validator.required(diploma_school)
     Validator.length(diploma_school, 2, 50)
Ejemplo n.º 7
0
 def validate_diploma_name(self, diploma_name):
     Validator.required(diploma_name)
     Validator.length(diploma_name, 2, 50)
Ejemplo n.º 8
0
 def validate_not_company(self, not_company):
     if not_company.data:
         Validator.length(not_company, 2, 200)
Ejemplo n.º 9
0
 def validate_key_words(self, key_words):
     Validator.required(key_words)
     Validator.length(key_words, 6, 300)
     _key_words = key_words.data.split(",")
     if not len(_key_words) >= 3:
         raise ValidationError('3 or more words')
Ejemplo n.º 10
0
 def validate_job(self, job):
     Validator.required(job)
     Validator.length(job, 3, 50)
Ejemplo n.º 11
0
 def validate_company(self, company):
     Validator.required(company)
     Validator.length(company, 2, 50)
Ejemplo n.º 12
0
 def validate_birthdate(self, birthdate):
     Validator.required(birthdate)
     Validator.length(birthdate, 8, 12)
     Validator.date(birthdate)
Ejemplo n.º 13
0
 def validate_lastname(self, lastname):
     Validator.required(lastname)
     Validator.length(lastname, 2, 40)
Ejemplo n.º 14
0
 def validate_firstname(self, firstname):
     Validator.required(firstname)
     Validator.length(firstname, 2, 40)
Ejemplo n.º 15
0
 def validate_resume_name(self, resume_name):
     Validator.required(resume_name)
     Validator.length(resume_name, 3, 40)
Ejemplo n.º 16
0
 def validate_name(self, name):
     Validator.required(name)
     Validator.length(name, 3, 40)
Ejemplo n.º 17
0
 def validate_other_languages(self, other_languages):
     if other_languages.data:
         Validator.length(other_languages, 0, 200)
Ejemplo n.º 18
0
 def _validate_diploma_town(diploma_town):
     Validator.required(diploma_town)
     Validator.length(diploma_town, 2, 50)
Ejemplo n.º 19
0
 def validate_birth_zip_code(self, birth_zip_code):
     Validator.required(birth_zip_code)
     Validator.length(birth_zip_code, 5, 5)
     Validator.numerical(birth_zip_code)
Ejemplo n.º 20
0
 def validate_birth_town(self, birth_town):
     Validator.required(birth_town)
     Validator.length(birth_town, 2, 50)
Ejemplo n.º 21
0
 def validate_xp_at_company(self, xp_at_company):
     Validator.required(xp_at_company)
     Validator.length(xp_at_company, 1, 2)
     Validator.xp(xp_at_company)
Ejemplo n.º 22
0
 def validate_xp_at_work(self, xp_at_work):
     Validator.required(xp_at_work)
     Validator.length(xp_at_work, 1, 2)
     Validator.xp(xp_at_work)
Ejemplo n.º 23
0
 def validate_xp_at_job(self, xp_at_job):
     Validator.required(xp_at_job)
     Validator.length(xp_at_job, 1, 2)
     Validator.xp(xp_at_job)
Ejemplo n.º 24
0
 def validate_email(self, email):
     Validator.required(email)
     Validator.length(email, 5, 40)
Ejemplo n.º 25
0
 def validate_town(self, town):
     Validator.required(town)
     Validator.length(town, 2, 50)
Ejemplo n.º 26
0
 def validate_company(self, company):
     if company.data:
         Validator.length(company, 2, 200)
Ejemplo n.º 27
0
 def validate_confirm_password(self, confirm_password):
     Validator.required(confirm_password)
     Validator.length(confirm_password, 8, 40)
     if not self.password.data == confirm_password.data:
         raise ValidationError(f"Les mots de passe ne sont pas identiques.")
Ejemplo n.º 28
0
 def validate_zip_code(self, zip_code):
     Validator.required(zip_code)
     Validator.length(zip_code, 5, 5)
     Validator.numerical(zip_code)
Ejemplo n.º 29
0
 def validate_password(self, password):
     Validator.required(password)
     Validator.length(password, 8, 40)
     Validator.password_hard(password)
Ejemplo n.º 30
0
 def validate_fond_concurency(self, fond_concurency):
   Validator.length(fond_concurency, 0, 300)