Skip to content

Commit

Permalink
Local resources will not based on FLASK_ENV
Browse files Browse the repository at this point in the history
  • Loading branch information
greyli committed Aug 10, 2018
1 parent 702059b commit 691cf81
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
2 changes: 1 addition & 1 deletion flask_share/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down
6 changes: 0 additions & 6 deletions test_flask_share.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 691cf81

Please sign in to comment.