takahe/users/context.py
2023-01-13 16:12:05 -07:00

11 lines
290 B
Python

from users.services import AnnouncementService
def user_context(request):
return {
"announcements": (
AnnouncementService(request.user).visible()
if request.user.is_authenticated
else AnnouncementService.visible_anonymous()
)
}