Files
Rasadyar_Users/Notification/__pycache__/views.cpython-39.pyc

39 lines
4.3 KiB
Plaintext
Raw Normal View History

2026-01-18 12:05:56 +03:30
a
<03>i<00>@s<>ddlZddlZddlZddlmZddlmZddlmZddl m
Z
m Z ddl m Z ddlmZmZmZdd lmZmZdd
lmZmZdd lmZmZdd lmZdd lmZdZGdd<10>de
j <20>Z!dS)<11>N)<01>render)<01>DjangoFilterBackend)<01> UserIdentity)<02>viewsets<74>status)<01> upload_object<63>)<03> Notification<6F>NotificationType<70>NotificationToken)<02>!send_notification_to_all_segments<74>%send_notification_to_specific_segment)<02>User<65>Group)<02>NotificationTokenSerializer<65>NotificationSerializer)<01>AllowAny)<01>Responsez<https://notification-gallery.s3.ir-thr-at1.arvanstorage.com/c@s0eZdZej<04><05>ZeZe gZ
dd<02>Z dd<04>Z dS)<06>NajvaNotificationViewSetcOs\d|jvr8tjj|jdd<02>}|<00>|<04>}t|jtjd<03>Sd|jvr<>tjj |j
j d|jdd<07>}dd <09>|D<00>}|j|d
d <0B>}t|jtjd<03>Sd |jvr<>tjj |j
j d |jdd<07>}dd <09>|D<00>}|j|d
d <0B>}t|jtjd<03>Sd|jv<00>r0tjj |j
j d|jdd<07>}dd <09>|D<00>}|j|d
d <0B>}t|jtjd<03>Stj<02> <0C>}|j|d
d <0B>}t|jtjd<03>SdS)N<>key<65>Z
key__exact<EFBFBD>rZ
read_notif<EFBFBD>read<61>app_name)<03>user_idrrcSsg|]}|<01>qS<00>r<00><02>.0<EFBFBD>xrr<00>:C:\rasadyar_proj_docker\user-backend\Notification\views.py<70>
<listcomp>/<00>z1NajvaNotificationViewSet.list.<locals>.<listcomp>T)<01>manyZ unread_notif<69>unreadcSsg|]}|<01>qSrrrrrrr 8r!Z pending_notif<69>pendingcSsg|]}|<01>qSrrrrrrr Ar!) <0A>GETr <00>objects<74>get<65>serializer_classr<00>datar<00> HTTP_200_OK<4F>filter<65>user<65>id<69>all)<08>self<6C>request<73>args<67>kwargsZadd_obj<62>
serializer<EFBFBD>query<72>querysetrrr<00>list$sD


<08>
<08> <08>
zNajvaNotificationViewSet.listc Osg}tjj|jd<01>}d<02>tjtjtj dd<04><02>}t
<EFBFBD>}d|j <0B> <0C>vr<>|j d}t |dd<07>t|<06><01>d<08>td<07>t|<06><01>} t<11>d<07>t|<06><01><01>nd} d |j <0B> <0C>vr<>|j d }
t |
dd<07>t|<06><01>d<08>td<07>t|<06><01>} t<11>d<07>t|<06><01><01>nd} d
|j <0B> <0C>v<00>rn|j d
d k<02>rntjj|d<01><01>s\t<13>}|j d |_||_|j d |_|<07><17>td ditjd<0F>Std ditjd<0F>Sd|j <0B> <0C>v<00>rz|j d<00>s<>t|j d|j d|j d| | |j d|j dd<17>} tjjdd<19>|_n<>|j dD]b} tjj| d<1A><01>rtjj| d<1B>}|<04>|j<15>t jj| d<1C><01>r<>tjj| d<1D>D]}|<04>|j<15><00>q&<26>q<>t!|j d|j d|j d| | |d<1E>} tjj|j d
d<19>|_|j d|_"|j d|_#| |_$| |_%|j d |_|<07><17>d|j <0B> <0C>v<00>r|j dD]2} t&jj| d<1A><01>r<>t&jj| d<1A>j}|j'<27>(|<10><00>q<>t| <0C>S)N)r,<00><00>)<01>k<>imageznotification-galleryz{0}.jpg)Z
image_dataZ bucket_name<6D> object_name<6D>iconZ request_type<70>tokenr<00>msgZDonerzuser already has token<65>value<75>title<6C>body<64>content<6E>segments_include<64>segments_exclude)r@rArBr<r:rCrD<00>alluser)<01>namer)Zuser__key__exact)<01> name__exact)Zuser__role__name)r@rArBr<r:Zsubscriber_tokens))rr&r'r,<00>join<69>random<6F>choices<65>string<6E>ascii_uppercase<73>digitsr r)<00>keysr<00>format<61>str<74>ARVAN_NOTIFICATION_GALLERY_URL<52>os<6F>remover r+r=r<00>saverrr*<00>HTTP_403_FORBIDDENr r
<00>
notif_type<EFBFBD>appendrr r@rBr<r:r<00>notification_user<65>add)r/r0r1r2<00>segmentsZ userprofileZran<61> notificationr:Znotification_imager<Znotification_iconZsend_notificationrZ
notif_user<EFBFBD>itemr,rrr<00>createIs<>
 <0C>
 <0C>   <08>  <02>   zNajvaNotificationViewSet.createN) <0A>__name__<5F>
__module__<EFBFBD> __qualname__r r&r.r5rr(r<00>permission_classesr6r]rrrrrs

%r)"rRrIrK<00>django.shortcutsrZdjango_filters.rest_frameworkrZAuthentication.modelsr<00>rest_frameworkrrZCore.ArvanStorage.arvan_storager<00>modelsr r
r Znajva.send_notif_to_segmentsr r <00>django.contrib.auth.modelsrr<00> serializersrr<00>rest_framework.permissionsr<00>rest_framework.responserrQ<00> ModelViewSetrrrrr<00><module>s