| Server IP : 65.108.144.40 / Your IP : 216.73.217.165 Web Server : Apache/2.4.52 (Ubuntu) System : Linux ubuntu-8gb-hel1-1 5.15.0-173-generic #183-Ubuntu SMP Fri Mar 6 13:29:34 UTC 2026 x86_64 User : dev ( 1000) PHP Version : 8.2.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/erp/attendance/__pycache__/ |
Upload File : |
o
hͦhH � @ s0 d Z ddlmZ ddlmZ G dd� de�ZdS )za
This module defines the configuration for the 'attendance' app within the Horilla HRMS project.
� )� AppConfig)�APP_URLSc s0 e Zd ZdZdZdZ� fdd�Zdd� Z� ZS )�AttendanceConfiga3
Configures the 'attendance' app and performs additional setup during the app's
initialization. This includes appending the 'attendance' URL patterns to the
project's main urlpatterns and dynamically adding the 'AttendanceMiddleware'
to the middleware stack if it's not already present.
zdjango.db.models.BigAutoField�
attendancec s� ddl m}m} ddlm} ddlm} |�|d|d��� d}||vr)|�|� t�d� z| � � W n Y t
� �� d S )Nr )�include�path)�
MIDDLEWARE)�urlpatternszattendance/zattendance.urlsz*attendance.middleware.AttendanceMiddleware)�django.urlsr r �horilla.settingsr �horilla.urlsr �appendr �create_enable_disable_check_in�super�ready)�selfr r r r �middleware_path�� __class__� �/var/www/erp/attendance/apps.pyr s �
zAttendanceConfig.readyc C s` ddl m} ddlm} |j�� }|D ]}|jj|d��� s-z |jj|d� W q Y qqdS )z�
Checks if an AttendanceGeneralSetting object exists for each company.
If it doesn't exist, creates one.
r )�AttendanceGeneralSetting)�Company)�
company_idN) �attendance.modelsr �base.modelsr �objects�all�filter�exists�create)r r r � companies�companyr r r r ) s
��z/AttendanceConfig.create_enable_disable_check_in) �__name__�
__module__�__qualname__�__doc__�default_auto_field�namer r �
__classcell__r r r r r
s r N)r&