Skip to content

Context processors

hypha.apply.activity.context_processors

notification_context

notification_context(request)
Source code in hypha/apply/activity/context_processors.py
def notification_context(request):
    context_data = {}
    if hasattr(request, "user"):
        if request.user.is_authenticated and request.user.is_apply_staff:
            context_data["latest_notifications"] = (
                Activity.objects.filter(current=True)
                .latest()
                .order_by("-timestamp")[:5]
            )
    return context_data