浏览代码

[core] Avoid old Hue 3 warning for API calls

Romain Rigaux 4 年之前
父节点
当前提交
4a901ca04d
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      desktop/core/src/desktop/views.py

+ 1 - 1
desktop/core/src/desktop/views.py

@@ -552,7 +552,7 @@ def get_banner_message(request):
   if hasattr(request, 'environ'):
     message = None
     path_info = request.environ.get("PATH_INFO")
-    if path_info.find("/hue") < 0 and path_info.find("accounts/login") < 0:
+    if path_info.find("/hue") < 0 and path_info.find("accounts/login") < 0 and not request.path.startswith('/api/'):
       url = request.build_absolute_uri("/hue")
       link = '<a href="%s" style="color: #FFF; font-weight: bold">%s</a>' % (url, url)
       message = _('You are accessing an older version of Hue, please switch to the latest version: %s.') % link