def information(request, tplname="core/information.html"): status, extensions = check_for_updates(request) return render_to_json_response({ "content": render_to_string(tplname, { "update_avail": status, "extensions": extensions, }), })
def check_for_new_versions(request, include_all): """Check if new versions are available.""" from modoboa.core.utils import check_for_updates if not request.user.is_superuser: return [] status, extensions = check_for_updates(request) if not status: return [{"id": "newversionavailable"}] if include_all else [] return [{ "id": "newversionavailable", "url": reverse("core:index") + "#info/", "text": _("One or more updates are 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 check_for_updates if not request.user.is_superuser: return [] status, extensions = check_for_updates(request) if not status: return [{"id": "newversionavailable"}] if include_all else [] return [{ "id": "newversionavailable", "url": reverse("core:index") + "#info/", "text": _("One or more updates are available"), "level": "info", }]