7 lines
292 B
Python
7 lines
292 B
Python
![]() |
def unread_notifications_count(request):
|
||
|
if not request.user.is_authenticated:
|
||
|
return {"notifications_unread_count": 0}
|
||
|
from .models import Notification
|
||
|
return {
|
||
|
"notifications_unread_count": Notification.objects.filter(user=request.user, read=False).count()
|
||
|
}
|