Skip to content
This repository has been archived by the owner on May 11, 2018. It is now read-only.

Commit

Permalink
Simplify green / red with ternary if
Browse files Browse the repository at this point in the history
  • Loading branch information
cclauss committed Jun 24, 2017
1 parent 5443a27 commit 492598d
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions gosecure_app.py
Expand Up @@ -207,13 +207,8 @@ def status():

if request.method == "GET":
# check to see if network and vpn are active, red=not active, green=active
internet_status_color = "red"
if internet_status():
internet_status_color = "green"
vpn_status_color = "red"
if vpn_status():
vpn_status_color = "green"

internet_status_color = "green" if internet_status() else "red"
vpn_status_color = "green" if vpn_status() else "red"
return render_template("status.html", form=form, internet_status_color=internet_status_color, vpn_status_color=vpn_status_color)


Expand Down

0 comments on commit 492598d

Please sign in to comment.