[UPDT] EMPLOYEE: Add work_email to get_email method

This commit is contained in:
Horilla
2025-02-26 15:33:09 +05:30
parent 7f824345a5
commit 842f83110f

View File

@@ -177,7 +177,9 @@ class Employee(models.Model):
"""
This method is used to return the shift of the employee
"""
return getattr(getattr(self, "employee_work_info", None), "email", self.email)
work_info = getattr(self, "employee_work_info", None)
work_email = getattr(work_info, "email", None)
return work_email if work_email is not None else self.email
def get_email(self):
return self.get_mail()