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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/erp/asset/__pycache__/scheduler.cpython-310.pyc
o

hͦh�@s�dZddlZddlmZmZddlmZddlmZddl	m
Z
dd�Zd	d
�Ze
dd�d
D��sJe�Zejeddd�ejeddd�e��dSdS)z?
scheduler.py

This module is used to register scheduled tasks
�N)�date�	timedelta)�BackgroundScheduler)�reverse)�notifyc
Cs�ddlm}ddlm}t��}|j��}|jjdd��	�}|D]T}|j
rt|j
}|t|jd�}||krtt
j||jjd|j�d|j�d	�d
|j�d|j�d�d
|j�d|j�d�d|j�d|j�d�d|j�d|j�d�td�ddd�
q dS)zV
    Finds all Expiring Assets and send a notification on the notify_before date.
    r��User)�Asset�Horilla Bot��username��dayszThe Asset ' � ' expires in z daysu%تنتهي صلاحية الأصل ' u ' خلال u%                    من الأيامz
Das Asset u läuft in z! Tagen                        ab.z
El activo z caduca en u días.zL'actif z
 expire dans z jours.�asset-category-view�System�information�	�	recipient�verb�verb_ar�verb_de�verb_es�verb_fr�redirect�label�iconN)�django.contrib.auth.modelsr�asset.modelsr	r�today�objects�all�filter�first�expiry_dater�
notify_beforer�send�owner�employee_user_id�
asset_namer)rr	r�assets�bot�assetr$�notify_date�r.�/var/www/erp/asset/scheduler.py�notify_expiring_assetss0
���r0c
Cs�ddlm}ddlm}t��}|j��}|jjdd��	�}|D][}|j
r{|j
}|t|jd�}||krtt
j||jjd|j�d|j�d	�d
|j�d|j�d�d
|j�d|j�d�d|j�d|j�d�d|j�d|j�d�td�ddd�
||kr{d|_q dS)zY
    Finds all Expiring Documents and send a notification on the notify_before date.
    rr)�Documentr
rr
zThe document ' rz                        daysu(تنتهي صلاحية المستند 'u' خلال u                    يومzDas Dokument 'u' läuft in z!                        Tagen ab.zEl documento 'z' caduca en u                        díasz
Le document 'z' expire dans z                        joursrrrrFN)rr�horilla_documents.modelsr1rrr r!r"r#r$rr%rr&�employee_idr(�titler�	is_active)rr1r�	documentsr+�documentr$r-r.r.r/�notify_expiring_documents1s4
���r8ccs�|]}|tjvVqdS)N)�sys�argv)�.0�cmdr.r.r/�	<genexpr>Ws
��
�r=)�makemigrations�migrate�compilemessages�flush�shell�interval�)�hours)�__doc__r9�datetimerr�!apscheduler.schedulers.backgroundr�django.urlsr�notifications.signalsrr0r8�any�	scheduler�add_job�startr.r.r.r/�<module>s !&��

Youez - 2016 - github.com/yon3zu
LinuXploit