Skip to content

Commit

Permalink
Clean up Flake8 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathansick committed Jun 19, 2018
1 parent 31d715a commit 7652c1e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions squash/dash/views.py
Expand Up @@ -14,7 +14,8 @@
SQUASH_GRAPHQL_URL = os.environ.get('SQUASH_GRAPHQL_URL', None)

# list of allowed bokeh apps
SQUASH_BOKEH_APPS = os.environ.get('SQUASH_BOKEH_APPS', 'monitor code_changes AMx')
SQUASH_BOKEH_APPS = os.environ.get('SQUASH_BOKEH_APPS',
'monitor code_changes AMx')
# code_changes is the default monitor app
SQUASH_MONITOR_APP = os.environ.get('SQUASH_MONITOR_APP', 'code_changes')

Expand All @@ -24,7 +25,7 @@ def is_server_up(url):
server_up = True
try:
requests.head(url)
except:
except Exception:
server_up = False

return server_up
Expand Down Expand Up @@ -73,10 +74,12 @@ def api(request):
url = urllib.parse.urljoin(SQUASH_API_URL, "/apidocs")
return HttpResponseRedirect(url)


def graphql(request):
"""Redirect to the GraphQL service"""
return HttpResponseRedirect(SQUASH_GRAPHQL_URL)


def home(request):
"""Render the initial page, including statistics"""

Expand All @@ -85,7 +88,8 @@ def home(request):
"number_of_metrics": None,
"number_of_measurements": None}
try:
context = requests.get("{}/stats".format(SQUASH_API_URL)).json()['stats']
context = requests.get("{}/stats".format(SQUASH_API_URL))\
.json()['stats']
except Exception:
print("Could not reach {}/stats".format(SQUASH_API_URL))

Expand Down

0 comments on commit 7652c1e

Please sign in to comment.