From 691cf8156cccee383015fd73f56ab5f2fdb1cb15 Mon Sep 17 00:00:00 2001 From: Grey Li Date: Fri, 10 Aug 2018 18:09:49 +0800 Subject: [PATCH] Local resources will not based on FLASK_ENV --- flask_share/__init__.py | 2 +- test_flask_share.py | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/flask_share/__init__.py b/flask_share/__init__.py index 0b984fe..b451f4f 100644 --- a/flask_share/__init__.py +++ b/flask_share/__init__.py @@ -45,7 +45,7 @@ def load(css_url=None, js_url=None, serve_local=False): :param js_url: if set, will be used as js url. :param serve_local: if set to True, the local resource will be used. """ - if serve_local or current_app.config['SHARE_SERVE_LOCAL'] or current_app.config['ENV'] == 'development': + if serve_local or current_app.config['SHARE_SERVE_LOCAL']: css_url = url_for('share.static', filename='css/share.min.css') js_url = url_for('share.static', filename='js/social-share.min.js') diff --git a/test_flask_share.py b/test_flask_share.py index 83bda17..a1357be 100644 --- a/test_flask_share.py +++ b/test_flask_share.py @@ -90,9 +90,3 @@ def test_local_resources(self): response = self.client.get('/share/static/css/share.min.css') self.assertNotEqual(response.status_code, 404) - - def test_local_resources_on_dev(self): - current_app.config['ENV'] = 'development' - - response = self.client.get('/share/static/css/share.min.css') - self.assertNotEqual(response.status_code, 404)