
    4h}                         d dl  d Zy)   )*c                    | j                   j                  sg dddS | j                   }t        j                  j	                         }t
        j                  j	                         }|j                  dk(  rCt        j                  j                  ddg      }t
        j                  j                  |      }n@t        j                  j                  |      }t
        j                  j                  |      }t        |      t        |      z   }t        |d	 d
      }|j                  d      j                         }|j                  d      j                         }|||z   |dS )N    )combined_notificationsnotification_countunread_messages_countadmin
user_eventsystem_alert)category__in)receiver)recipient_userc                     | j                   S )N)
created_at)xs    C/var/www/html/janka_web_project/janka_web_app/context_processors.py<lambda>z'notifications_context.<locals>.<lambda>   s    Q\\    T)keyreverseF)	is_viewed)read)useris_authenticatedNotificationobjectsnoneMessage	user_rolefilterlistsortedcount)requestr   notificationsmessagescombinedsorted_combinednotification_unreadmessage_unreads           r   notifications_contextr+      sC   <<((&("#%&
 	
 <<D ((--/M##%H~~ $,,33&7 4 
 ??))4)8 %,,3343H??))4)8 M"T(^3HX+A4PO (...?EEG__%_0668N #21NB!/ r   N)modelsr+    r   r   <module>r.      s    #r   