def default_context(request): """Return context needed for all CTFlex templates This context processor is included as the global context processor in `settings.py`; therefore, it should not be manually included. """ return { 'team': request.user.competitor.team if queries.is_competitor(request.user) else None, 'contact_email': settings.CONTACT_EMAIL, 'js_context': '{}', 'incubating': settings.INCUBATING, }
def mark_announcements_read(user): if queries.is_competitor(user): user.competitor.unread_announcements.clear()