3
Y_V                 @   sT   d dl mZ d dlmZmZ d dlmZ d dlmZ d dl	m
Z
 dd Zdd	 Zd
S )    )User)AdminNotifications)Customer)DriverModel)settingsc             C   sR   d}| j jdrF| j d }tjj|dj }|rFtjj|dddj }dt|iS )Nr   email)r   unreadF)userstatusdeletedunread_notifications_count)	sessionhas_keyr   objectsfilterfirstr   countstr)requestr   	email_valuser_obj r   :/var/www/html/GoodsDelivery/Customer/context_processors.pygetunreadnotificationcount   s    
r   c             C   s  d}g }d}| j jdr| j d }tjj|dj }|rtjj|dddj }| j jdr| j d d	ksv| j d d
krtjj|dj }nP| j d dkrt	jj|dj }n.| j d dks| j d dkrt
jj|dj }|jrttj|jj }nd}||t|dS )Nr    r   )r   r	   F)r
   r   r   userrolecustomercompany)r
   driveradmin
superadmin)Z
userdetailZ	userimager   )r   r   r   r   r   r   r   r   r   r   r   imager   r   WEB_BASE_URLname)r   r   Zuserdetails_objr"   r   r   r   r   r   getuserdetails   s&    
r%   N)django.contrib.auth.modelsr   ZAdminApp.modelsr   r   Customer.modelsr   Driver.modelsr   django.confr   r   r%   r   r   r   r   <module>   s   