Example #1
0
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,
    }
Example #2
0
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,
    }
Example #3
0
def mark_announcements_read(user):
    if queries.is_competitor(user):
        user.competitor.unread_announcements.clear()
Example #4
0
def mark_announcements_read(user):
    if queries.is_competitor(user):
        user.competitor.unread_announcements.clear()