Milimetric has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/73169


Change subject: fixed up static path handling and favicon
......................................................................

fixed up static path handling and favicon

Change-Id: Iec41d79fc7259aeced80ce4baf1aee17c2d5d789
---
M wikimetrics/controllers/authentication.py
M wikimetrics/controllers/home.py
2 files changed, 9 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/wikimetrics 
refs/changes/69/73169/1

diff --git a/wikimetrics/controllers/authentication.py 
b/wikimetrics/controllers/authentication.py
index a4a9a97..0321896 100644
--- a/wikimetrics/controllers/authentication.py
+++ b/wikimetrics/controllers/authentication.py
@@ -38,7 +38,8 @@
     # TODO: put static resources in a new Blueprint
     if (
             request.endpoint
-        and not 'static' in request.endpoint
+        and not request.path.startswith('/static/')
+        and not request.path == 'favicon.ico'
         and not getattr(app.view_functions[request.endpoint], 'is_public', 
False)
     ):
         flash('Please Login before visiting ' + request.url, 'info')
diff --git a/wikimetrics/controllers/home.py b/wikimetrics/controllers/home.py
index bac50da..71ffd8f 100644
--- a/wikimetrics/controllers/home.py
+++ b/wikimetrics/controllers/home.py
@@ -1,4 +1,4 @@
-from flask import render_template
+from flask import render_template, send_from_directory
 from ..configurables import app
 from authentication import is_public
 
@@ -10,3 +10,9 @@
     Renders the home page.
     """
     return render_template('index.html')
+
+
[email protected]('/favicon.ico')
+@is_public
+def favicon():
+    return send_from_directory(app.static_folder, 'favicon.ico')

-- 
To view, visit https://gerrit.wikimedia.org/r/73169
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iec41d79fc7259aeced80ce4baf1aee17c2d5d789
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wikimetrics
Gerrit-Branch: master
Gerrit-Owner: Milimetric <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to