+
+
+
+
+ {{f.form.employee_id}}
+
+
+
+ {{f.form.employee_id__employee_work_info__department_id}}
+
+
+
+ {{f.form.shift_id}}
+
+
+
+ {{f.form.employee_id__employee_work_info__reporting_manager_id}}
+
-
-
-
-
- {{f.form.employee_id__employee_work_info__company_id}}
+
+
+ {% comment %} {{f.form}} {% endcomment %}
+
+
+
+
+
+
+
+ {{f.form.attendance_date}}
+
+
+
+ {{f.form.attendance_clock_in}}
+
+
+
+ {{f.form.attendance_validated}}
+
-
+
+
+
+
+
+
+
+
+ {{f.form.attendance_date__gte}}
+
+
+
+ {{f.form.attendance_clock_in__gte}}
+
+
+
+ {{f.form.attendance_clock_out__gte}}
+
+
+
+ {{f.form.at_work_second__gte}}
+
+
+
+ {{f.form.overtime_second__gte}}
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- {% comment %} {{f.form}} {% endcomment %}
-
-
-
-
-
-
-
- {{f.form.attendance_date}}
-
-
-
- {{f.form.attendance_clock_in}}
-
-
-
- {{f.form.attendance_validated}}
-
-
-
-
-
- {{f.form.minimum_hour}}
-
-
-
- {{f.form.attendance_clock_out}}
-
-
-
- {{f.form.attendance_overtime_approve}}
-
-
-
-
+
-
-
-
-
-
-
-
- {{f.form.attendance_date__gte}}
-
-
-
- {{f.form.attendance_clock_in__gte}}
-
-
-
- {{f.form.attendance_clock_out__gte}}
-
-
-
- {{f.form.at_work_second__gte}}
-
-
-
- {{f.form.overtime_second__gte}}
-
-
-
-
-
- {{f.form.attendance_date__lte}}
-
-
-
- {{f.form.attendance_clock_in__lte}}
-
-
-
- {{f.form.attendance_clock_out__lte}}
-
-
-
- {{f.form.at_work_second__lte}}
-
-
-
- {{f.form.overtime_second__lte}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+
diff --git a/attendance/templates/attendance/attendance/attendance_nav.html b/attendance/templates/attendance/attendance/attendance_nav.html
index 6b6b5f5a7..83f80ce0f 100644
--- a/attendance/templates/attendance/attendance/attendance_nav.html
+++ b/attendance/templates/attendance/attendance/attendance_nav.html
@@ -1,23 +1,23 @@
-{% load static %} {% load i18n %} {% load basefilters %} {% if perms.attendance.add_attendance or request.user|is_reportingmanager %}
+{% load static %} {% load i18n %} {% load basefilters %}
+{% if perms.attendance.add_attendance or request.user|is_reportingmanager %}
+
{% csrf_token %}
-
-
-
-
{% trans "Uploading..." %}
-
-
-
-
-
+
+
+
+
{% trans "Uploading..." %}
+
+
+
+
+
@@ -222,61 +238,64 @@
>
{% if perms.attendance.add_attendance or request.user|is_reportingmanager%}
-
+
{% endif %}
diff --git a/attendance/templates/attendance/attendance/export_filter.html b/attendance/templates/attendance/attendance/export_filter.html
index 3ff6a6125..7f80bd13e 100644
--- a/attendance/templates/attendance/attendance/export_filter.html
+++ b/attendance/templates/attendance/attendance/export_filter.html
@@ -7,18 +7,19 @@
diff --git a/attendance/views/handle_attendance_errors.py b/attendance/views/handle_attendance_errors.py
index 00364c66c..83d72e11e 100644
--- a/attendance/views/handle_attendance_errors.py
+++ b/attendance/views/handle_attendance_errors.py
@@ -1,3 +1,6 @@
+"""Module for handling attendance error data."""
+
+
def handle_attendance_errors(error_list):
"""
Reorganize a list of error dictionaries into a structured error data dictionary
@@ -41,14 +44,17 @@ def handle_attendance_errors(error_list):
"Error17": [],
}
for item in error_list:
- for key in error_data.keys():
+ for key, value in error_data.items():
if key in item:
- error_data[key].append(item[key])
+ value.append(item[key])
else:
- error_data[key].append(None)
- for key, value in error_data.items():
- if all(v is None for v in value):
- keys_to_remove.append(key)
+ value.append(None)
+
+ keys_to_remove = [
+ key for key, value in error_data.items() if all(v is None for v in value)
+ ]
+
for key in keys_to_remove:
del error_data[key]
- return error_data
\ No newline at end of file
+
+ return error_data
diff --git a/attendance/views/process_attendance_data.py b/attendance/views/process_attendance_data.py
index 9d4ad2acd..12e80411e 100644
--- a/attendance/views/process_attendance_data.py
+++ b/attendance/views/process_attendance_data.py
@@ -1,12 +1,14 @@
+"""
+process_attendance_data.py
+
+This module contains a function for processing attendance data
+from Excel files and saving it to a database.
+"""
+from datetime import datetime
+import pandas as pd
+from employee.models import Employee
from attendance.models import Attendance
from base.models import EmployeeShift, WorkType
-from employee.models import Employee
-
-
-import pandas as pd
-
-
-from datetime import datetime
def process_attendance_data(attendance_dicts):
@@ -166,4 +168,4 @@ def process_attendance_data(attendance_dicts):
attendance_data["Error17"] = f"{str(exception)}"
error_list.append(attendance_data)
- return error_list
\ No newline at end of file
+ return error_list