-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue 241 #244
Issue 241 #244
Conversation
OpenOversight/app/email.py
Outdated
@@ -21,7 +21,7 @@ def send_email(to, subject, template, **kwargs): | |||
msg.body = render_template(template + ".txt", **kwargs) | |||
msg.html = render_template(template + ".html", **kwargs) | |||
# Only send email if we're in prod or staging, otherwise log it so devs can see it | |||
if app.env in ("staging", "production"): | |||
if app.debug in ("staging", "production"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @sea-kelp, I have changed app.env
to app.debug
. Is this fine?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We actually want to use app.config["ENVIRONMENT"]
instead of app.debug
to check the value of the new variable you've added!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, makes sense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! There is just one other place where FLASK_ENV
is used
Line 12 in 1de4c6b
FLASK_ENV=development # for prod: production |
OpenOversight/app/email.py
Outdated
@@ -21,7 +21,7 @@ def send_email(to, subject, template, **kwargs): | |||
msg.body = render_template(template + ".txt", **kwargs) | |||
msg.html = render_template(template + ".html", **kwargs) | |||
# Only send email if we're in prod or staging, otherwise log it so devs can see it | |||
if app.env in ("staging", "production"): | |||
if app.debug in ("staging", "production"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We actually want to use app.config["ENVIRONMENT"]
instead of app.debug
to check the value of the new variable you've added!
Hi @rsk2, looks like there's one more place where you need to make a change: This section: OpenOversight/OpenOversight/app/config.py Lines 11 to 12 in 1de4c6b
should be changed to: class BaseConfig(object):
ENVIRONMENT = os.environ.get("ENVIRONMENT", "")
# DB SETUP |
So close! The tests are failing because these two lines should have OpenOversight/OpenOversight/app/commands.py Line 534 in 1de4c6b
OpenOversight/OpenOversight/app/commands.py Line 575 in 1de4c6b
|
@sea-kelp , I have made the changes in OpenOversight/OpenOversight/app/commands.py Additionally, I ran |
It looks like the test run passed on here so I think it might just be a transient Selenium error? Really appreciate your help with fixing this issue! :) |
Thank you for the contribution @rsk2! |
I've updated our |
Description of Changes
Notes for Deployment
Screenshots (if appropriate)
Tests and linting
I have rebased my changes on
main
just lint
passesjust test
passes