[UPDT] added image path of employee
This commit is contained in:
@@ -29,6 +29,8 @@ def reporting_manager_validator(value):
|
||||
return value
|
||||
|
||||
|
||||
|
||||
|
||||
class Employee(models.Model):
|
||||
"""
|
||||
Employee model
|
||||
@@ -84,6 +86,15 @@ class Employee(models.Model):
|
||||
additional_info = models.JSONField(null=True, blank=True)
|
||||
objects = models.Manager()
|
||||
|
||||
def get_image(self):
|
||||
"""
|
||||
This method is used to return the profile image path of the employee
|
||||
"""
|
||||
url = False
|
||||
if self.employee_profile:
|
||||
url = self.employee_profile.url
|
||||
return url
|
||||
|
||||
def __str__(self) -> str:
|
||||
last_name = (
|
||||
self.employee_last_name if self.employee_last_name is not None else ""
|
||||
|
||||
Reference in New Issue
Block a user