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", }]
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", }]
def information(request, tplname="core/information.html"): return render_to_json_response({ "content": render_to_string(tplname, { "new_version": new_version_available(request) }), })