[fix] validate preferred email if set in employee.py

This commit is contained in:
Rushabh Mehta 2017-04-15 16:59:17 +05:30
parent 68a8b0c2a9
commit e3c117e32c

View File

@ -157,7 +157,7 @@ class Employee(Document):
delete_events(self.doctype, self.name)
def validate_prefered_email(self):
if not self.get(scrub(self.prefered_contact_email)):
if self.prefered_contact_email and not self.get(scrub(self.prefered_contact_email)):
frappe.msgprint(_("Please enter " + self.prefered_contact_email))