Beispiel #1
0
 def edit_student(student):
     students_dict = Student.mongoDB.get_all_students()
     Validators.all_required_fields(student)
     Validators.validate_name(student["first_name"], student["last_name"])
     Validators.validate_email(student["email"])
     # Validators.validate_student_exists(student, students_dict)
     student["last_update"] = str(datetime.now())
Beispiel #2
0
 def add_new_student(student):
     students_dict = Student.mongoDB.get_all_students()
     Validators.all_required_fields(student)
     Validators.validate_name(student['first_name'], student['last_name'])
     Validators.validate_email(student['email'])
     # Validators.validate_id(student['student_id'])
     Validators.unique_email(student['email'], students_dict)
     return student
Beispiel #3
0
 def student_login(self):
     Validators.all_required_fields(self)
     Validators.validate_name(self.first_name, self.last_name)
     Validators.validate_email(self.email)
     Validators.validate_password(self.password)
     Validators.validate_id(self.id)
Beispiel #4
0
 def get_student_by_email(self):
     Validators.email_provided(self.email)
     Validators.validate_email(self.email)