From 2df0dd1bc520fa415076daa3c4643c017f67efa2 Mon Sep 17 00:00:00 2001 From: Horilla Date: Tue, 26 Aug 2025 17:21:50 +0530 Subject: [PATCH] [FIX] BASE: Fixed shift request detail view not showing for employees without work info --- base/models.py | 7 ++- base/templates/mail/empty_mail_template.html | 53 ++++++-------------- base/templates/mail/view_templates.html | 2 +- 3 files changed, 22 insertions(+), 40 deletions(-) diff --git a/base/models.py b/base/models.py index 3966842c6..122f401d7 100644 --- a/base/models.py +++ b/base/models.py @@ -1672,8 +1672,11 @@ class ShiftRequest(HorillaModel): Detail view subtitle """ - return f"""{self.employee_id.employee_work_info.department_id } / - { self.employee_id.employee_work_info.job_position_id}""" + try: + return f"""{self.employee_id.employee_work_info.department_id } / + { self.employee_id.employee_work_info.job_position_id}""" + except: + return None def clean(self): diff --git a/base/templates/mail/empty_mail_template.html b/base/templates/mail/empty_mail_template.html index 6b41b8f82..c49e4d31b 100644 --- a/base/templates/mail/empty_mail_template.html +++ b/base/templates/mail/empty_mail_template.html @@ -1,50 +1,29 @@ {% extends 'index.html' %} {% load static i18n %} {% block content %} -
-
+

{% trans "Mail Templates" %}

{% if perms.base.add_horillamailtemplate %} - + {% endif %}
-
-
-
- Page not found. 404. -
- {% trans "There are currently no email templates." %} -
-
-
-
+
+
+ Page not found. 404. +

{% trans "No Records found." %}

+

{% trans "There are currently no email templates available." %}

+
+
{% endblock content %} diff --git a/base/templates/mail/view_templates.html b/base/templates/mail/view_templates.html index 1a968af1a..dd857014e 100644 --- a/base/templates/mail/view_templates.html +++ b/base/templates/mail/view_templates.html @@ -52,7 +52,7 @@ class="text-danger" style="cursor: pointer" onclick="return confirm('Do you want to delete this template?')" - title="{% trans 'Edit' %}" + title="{% trans 'Delete' %}" >