예제 #1
0
파일: __init__.py 프로젝트: JHei/modoboa
def check_for_new_version(user, include_all):
    """
    Check if a new version of Modoboa is available.
    """
    from modoboa.core.utils import new_version_available

    if not user.is_superuser:
        return []
    if new_version_available() is None:
        return [{"id": "newversionavailable"}] if include_all else []
    return [{
        "id": "newversionavailable",
        "url": reverse("admin_index") + "#info/",
        "text": _("New Modoboa version available"),
        "level": "info",
    }]
예제 #2
0
파일: __init__.py 프로젝트: rabbitt/modoboa
def check_for_new_version(request, include_all):
    """
    Check if a new version of Modoboa is available.
    """
    from modoboa.core.utils import new_version_available

    if not request.user.is_superuser:
        return []
    if new_version_available(request) is None:
        return [{"id": "newversionavailable"}] if include_all else []
    return [{
        "id": "newversionavailable",
        "url": reverse("core:index") + "#info/",
        "text": _("New Modoboa version available"),
        "level": "info",
    }]
예제 #3
0
def information(request, tplname="core/information.html"):
    return render_to_json_response({
        "content": render_to_string(tplname, {
            "new_version": new_version_available(request)
        }),
    })
예제 #4
0
파일: admin.py 프로젝트: finid/modoboa
def information(request, tplname="core/information.html"):
    return render_to_json_response({
        "content": render_to_string(tplname, {
            "new_version": new_version_available(request)
        }),
    })