Skip to content
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

Add 'locale' field to JustfixUser model. #1472

Merged
merged 3 commits into from
May 21, 2020
Merged

Add 'locale' field to JustfixUser model. #1472

merged 3 commits into from
May 21, 2020

Conversation

toolness
Copy link
Collaborator

@toolness toolness commented May 20, 2020

This helps with #1384 by adding a locale field to the JustfixUser model. This will help us when we need to initiate tasks on behalf of the user from a context where we can't retrieve their email from a request, e.g. sending them an email or text message from a worker process.

The locale field is set when a user first onboards with us, and its value is taken from the request, so if the user onboards in Spanish, locale will be es.

Note: Because Django doesn't actually set defaults at the database schema level, pushing this change to production might require us to temporarily disable Heroku Preboot, since old dynos creating new users post-migration won't know about the locale column and Postgres will demand that they set it.

To do

  • When a user signs up, set their locale to the locale of the request.
  • Add tests.

@toolness toolness merged commit f69026c into master May 21, 2020
@toolness toolness deleted the user-locale branch May 21, 2020 09:02
@toolness toolness mentioned this pull request May 21, 2020
33 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant