[UPDT] BASE: Update AttributeError handling for shift and work type requests, and update the label of the 'company_id' field on the candidate reject reasons form

This commit is contained in:
Horilla
2024-07-05 16:24:43 +05:30
parent 345e7de0f1
commit fc789c5945
6 changed files with 437 additions and 298 deletions

View File

@@ -888,6 +888,13 @@ class WorkTypeRequest(HorillaModel):
if not self.requested_till:
raise ValidationError(_("Requested till field is required."))
def request_status(self):
return (
_("Rejected")
if self.canceled
else (_("Approved") if self.approved else _("Requested"))
)
def __str__(self) -> str:
return f"{self.employee_id.employee_first_name} \
{self.employee_id.employee_last_name} - {self.requested_date}"