Skip to content

Commit

Permalink
Merge pull request #508 from dividehex/remove_flask_env
Browse files Browse the repository at this point in the history
Fix app.env that was causing 500 error on / route
  • Loading branch information
dividehex authored Aug 14, 2024
2 parents 6589b51 + 0911196 commit 039afe0
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion clouddeploy/sso-dashboard-dev.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ spec:
- name: AWS_DEFAULT_REGION
value: us-west-2
- name: ENVIRONMENT
value: Staging
value: development
- name: MOZILLIANS_API_URL
value: https://mozillians.org/api/v2/users/
- name: DASHBOARD_GUNICORN_WORKERS
Expand Down
2 changes: 1 addition & 1 deletion clouddeploy/sso-dashboard-prod.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ spec:
- name: AWS_DEFAULT_REGION
value: us-west-2
- name: ENVIRONMENT
value: Prod
value: production
- name: MOZILLIANS_API_URL
value: https://mozillians.org/api/v2/users/
- name: DASHBOARD_GUNICORN_WORKERS
Expand Down
2 changes: 1 addition & 1 deletion clouddeploy/sso-dashboard-staging.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ spec:
- name: AWS_DEFAULT_REGION
value: us-west-2
- name: ENVIRONMENT
value: Prod
value: staging
- name: MOZILLIANS_API_URL
value: https://mozillians.org/api/v2/users/
- name: DASHBOARD_GUNICORN_WORKERS
Expand Down
2 changes: 1 addition & 1 deletion dashboard/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def favicon():

@app.route("/")
def home():
if app.env == "development":
if config.Config(app).environment == "local":
return redirect("dashboard", code=302)

url = request.url.replace("http://", "https://", 1)
Expand Down
2 changes: 1 addition & 1 deletion dashboard/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Config(object):
def __init__(self, app):
self.app = app

self.environment = CONFIG("environment", default="development")
self.environment = CONFIG("environment", default="local")
self.settings = self._init_env()

def _init_env(self):
Expand Down

0 comments on commit 039afe0

Please sign in to comment.