Merge pull request #20657 from anuradha-8/develop

fix: date of birth cannot be greater than today on student application form
This commit is contained in:
Deepesh Garg 2020-02-18 14:10:47 +05:30 committed by GitHub
commit ecba5c40bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,10 +29,15 @@ class StudentApplicant(Document):
set_name_by_naming_series(self)
def validate(self):
self.validate_dates()
self.title = " ".join(filter(None, [self.first_name, self.middle_name, self.last_name]))
if self.student_admission and self.program and self.date_of_birth:
self.validation_from_student_admission()
def validate_dates(self):
if self.date_of_birth and getdate(self.date_of_birth) >= getdate():
frappe.throw(_("Date of Birth cannot be greater than today."))
def on_update_after_submit(self):
student = frappe.get_list("Student", filters= {"student_applicant": self.name})
if student: