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 :  /home/dev/code/erp/horilla_automations/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/dev/code/erp/horilla_automations/__pycache__/forms.cpython-310.pyc
o

��g��@s�dZddlmZddlmZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZdd	lmZmZdd
lmZddlmZGdd
�d
e	�ZdS)z
horilla_automations/forms.py
�)�Any)�forms)�gettext_lazy)�	ModelForm)�EmployeeFilter)�Employee)�generate_choices)�
MODEL_CHOICES�MailAutomation)�HorillaMultiSelectField)�HorillaMultiSelectWidgetcszeZdZdZeje��d�Zeje��d�ZddiZ	�fdd�Z
Gdd�d�Z�fd	d
�Zdde
d
ef�fdd�
Z�ZS)�AutomationFormz
    AutomationForm
    )�widget�template_attachments�c
s^t�j|i|��ttj��dtdtdd|jd�dt	d�d�|j
d	<|jscg}g}g}|jjr?t
|jj�d
}t
|jj�d}tj|d�|j
d
<tj|dd�|j
d<||j
d
_|j
d
jj}d|d<|j
djj}dgttt��|j
d_d|d<d|j
d_|��}|d=||j
dj_|jjr�|jj|j
d_|jj|j
d_|jj|j
d_dSdS)NFzemployee-widget-filter�fzemployee_filters.html)�filter_route_name�filter_class�filter_instance_contex_name�filter_template_path�instancezAlso Sent toz9The employees selected here will receive the email as Cc.)�queryset�requiredr�label�	help_text�also_sent_tor�)�choices�mail_tozcFill mail template details(reciever/instance, `self` will be the person who trigger the automation))rr�mail_detailszoh-select oh-select-2 w-100�class�model)�zSelect modelzgetToMail($(this))�onchange�
mail_template�	condition�condition_html�condition_querystring)�super�__init__rr�objects�allrrr�_�fields�data�pkrr!r�MultipleChoiceField�ChoiceField�initialr�attrs�list�setr	r�empty_label�copyr&r')�self�args�kwargsrr2�mail_details_choicer3��	__class__��./home/dev/erp/erp/horilla_automations/forms.pyr)sT��
���zAutomationForm.__init__c@seZdZeZdZdS)zAutomationForm.Meta�__all__N)�__name__�
__module__�__qualname__r
r!r-r>r>r>r?�MetaJsrDcsPt���}t|jdt�r&|j�dd�|jdjj|j	�
d�d�}||d<|S)Nr)�id__in)r(�clean�
isinstancer-r�errors�popr�filterr.�getlist)r8�cleaned_data�
employee_datar<r>r?rFNs

�zAutomationForm.clean.�commit�returncs^|j|_|jd}|jd}|j�d�}t|�|j_|jd|j_||j_||j_t	��
|�S)Nr'r&rr)rrLr.rK�strrrr'r&r(�save)r8rNr'r&rr<r>r?rQZs

zAutomationForm.save).)rArBrC�__doc__r�	CharField�HiddenInputr&r'�colsr)rDrF�boolrrQ�
__classcell__r>r>r<r?r
s- r
N)rR�typingr�djangor�django.utils.translationrr,�
base.formsr�employee.filtersr�employee.modelsr�#horilla_automations.methods.methodsr�horilla_automations.modelsr	r
�2horilla_widgets.widgets.horilla_multi_select_fieldr�&horilla_widgets.widgets.select_widgetsrr
r>r>r>r?�<module>s

Youez - 2016 - github.com/yon3zu
LinuXploit