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

Feature/daily not weekly #80

Merged
merged 7 commits into from Oct 26, 2012

Conversation

becdot
Copy link
Contributor

@becdot becdot commented Oct 25, 2012

Changes the weekly user emails to daily emails.

This patch touches a lot of files because a large number of variable and function names need to be changed (e.g. from email_me_weekly_re_projects to email_me_re_projects). I also updated the tests to reflect the changed timeframe (i.e. making sure that emails get sent every 24 hours instead of every 7 days) and completed three South migrations to add a new column, switch over the data, and then delete the old column.

All tests pass, and everything looked good to me on the local version of the website.

Please let me know whether any other changes need to be made.

Thanks!

Becca

Renames weekly_email__list_of_people.html and weekly_email_re_projects.html to email__list_of_people.html and email_re_projects.html, respectively
send_weekly_emails -> send_emails
email_me_weekly_re_projects -> email_me_re_projects
get_context__for_weekly_email_to -> get_context_for_email_to
'weekly' (in comments) -> 'periodically'
test_weekly_email_re_projects -> test_email_re_projects
Updates profile/tests.py to test that emails are sent within the correct timeframe (i.e. 24 hours)
Renames send_weekly_emails.py to send_emails.py
Updates send_emails.py to send emails every 24 hours; also renames a few relevant variable names.
Adds back old email_me_weekly_re_projects column in models.py (so that data doesn't get deleted in migration!)
Adds new email_me_re_projects column in models.py
Minor wording change in tests.py
Adds three migrations:
 - 0093 to add a new email_me_re_projects column
 - 0094 to set user email_me_weekly_re_projects == email_me_re_projects
 - 0095 to delete old email_me_weekly_re_projects column

Updates profile/models.py accordingly
Renames email_me_weekly_re_projects -> email_me_re_projects variables in static files (snapshot1.json, snapshot2.json, front-page-demo.html)
Deletes old weekly email files (that have been replaced by email__list_of_people.html, email_re_projects.html, send_emails.py)
Removes the word 'weekly' in a models.py comment and replaces it with 'periodically'
Update 0095 migration to only call person.save() if person.email_me_weekly_re_projects is different than person.email_me_re_projects
Fix spacing issue in profile/models.py
@paulproteus
Copy link
Contributor

Thanks for all these changes! As discussed on IRC, this changeset as a whole does the job, and does it very well.

Things you've improved since the start:

  • Splitting up the commits into smaller commits
  • Fixing the migration to retain old preferences
  • Enhancing the migration to run more efficiently (not saving objects that don't need saving)
  • New variable names don't hardcode daily/weekly so that if we change this again, the delta will be smaller

And the tests all pass.

Herculean effort, especially for your first patch! Thank you!

Find someone near you and ask them to give you a high five!

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.

None yet

2 participants