-
Notifications
You must be signed in to change notification settings - Fork 18
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
fix: add fallback value for cypress migration #2355
base: main
Are you sure you want to change the base?
Changes from 2 commits
4c1330d
eda7ec5
97b9eb0
6fe6a96
1fd7f2c
0b68636
85fa736
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,14 +28,13 @@ | |
email_template_id = current_app.config["CYPRESS_SMOKE_TEST_EMAIL_TEMPLATE_ID"] | ||
sms_template_id = current_app.config["CYPRESS_SMOKE_TEST_SMS_TEMPLATE_ID"] | ||
default_category_id = current_app.config["DEFAULT_TEMPLATE_CATEGORY_LOW"] | ||
cypress_user_pw = current_app.config.get( | ||
"CYPRESS_USER_PW_SECRET", uuid.uuid4().hex[:32] # if env var isn't present, use a random password | ||
) | ||
|
||
|
||
def upgrade(): | ||
password = hashpw( | ||
hashlib.sha256( | ||
(current_app.config["CYPRESS_USER_PW_SECRET"] + current_app.config["DANGEROUS_SALT"]).encode("utf-8") | ||
).hexdigest() | ||
) | ||
password = hashpw(hashlib.sha256((cypress_user_pw + current_app.config["DANGEROUS_SALT"]).encode("utf-8")).hexdigest()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Funny, the suggestion is exactly what is in the code. |
||
current_year = get_current_financial_year_start_year() | ||
default_limit = 250000 | ||
|
||
|
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.
Looks good! I wonder if a log should be printed to the console to warn about the fall back if it occurs. It's good as is though for me.
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.
Yeah thats a good idea, I'll add that in.
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.
Does that look good? Does logging work the same way in a migration as it does in the app?
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.
@jimleroyer 🥺