validation added - dob cannot accept a future date
This commit is contained in:
parent
d102cba71c
commit
20f0ef2515
@ -97,6 +97,9 @@ class Employee(Document):
|
|||||||
user.save()
|
user.save()
|
||||||
|
|
||||||
def validate_date(self):
|
def validate_date(self):
|
||||||
|
if self.date_of_birth and getdate(self.date_of_birth) > getdate(today()):
|
||||||
|
throw(_("Date of Birth cannot be greater than today."))
|
||||||
|
|
||||||
if self.date_of_birth and self.date_of_joining and getdate(self.date_of_birth) >= getdate(self.date_of_joining):
|
if self.date_of_birth and self.date_of_joining and getdate(self.date_of_birth) >= getdate(self.date_of_joining):
|
||||||
throw(_("Date of Joining must be greater than Date of Birth"))
|
throw(_("Date of Joining must be greater than Date of Birth"))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user