Пример #1
0
def inject_variable():
    ''' Inject into all templates variables that we would like to have all
    the time.
    '''
    justedit = flask.session.get('justedit', False)
    if justedit:  # pragma: no cover
        flask.session['justedit'] = None

    cron_status = utilities.get_last_cron(SESSION)

    return dict(
        version=__version__,
        is_admin=admin.is_admin(),
        justedit=justedit,
        cron_status=cron_status,
    )
Пример #2
0
Файл: app.py Проект: odra/anitya
def inject_variable():
    ''' Inject into all templates variables that we would like to have all
    the time.
    '''
    justedit = flask.session.get('justedit', False)
    if justedit:  # pragma: no cover
        flask.session['justedit'] = None

    cron_status = utilities.get_last_cron(Session)

    return dict(
        version=__version__,
        is_admin=admin.is_admin(),
        justedit=justedit,
        cron_status=cron_status,
        user=current_user,
        available_backends=load_backends(anitya_config['SOCIAL_AUTH_AUTHENTICATION_BACKENDS']),
    )
Пример #3
0
def inject_variable():
    """ Inject into all templates variables that we would like to have all
    the time.
    """
    justedit = flask.session.get("justedit", False)
    if justedit:  # pragma: no cover
        flask.session["justedit"] = None

    cron_status = utilities.get_last_cron(Session)

    return dict(
        version=__version__,
        is_admin=admin.is_admin(),
        justedit=justedit,
        cron_status=cron_status,
        user=current_user,
        available_backends=load_backends(
            anitya_config["SOCIAL_AUTH_AUTHENTICATION_BACKENDS"]
        ),
    )