Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Fix bug 1173780: Add SMS message id admin. #137

Merged
merged 1 commit into from
Jun 12, 2015

Conversation

pmclanahan
Copy link

In ET the ID of an SMS message we need to send them
changes when you edit it. So we need to be able to
update these easily.

@pmclanahan
Copy link
Author

@jgmize r?

@pmclanahan pmclanahan changed the title Add SMS message id admin. Fix bug 1173780: Add SMS message id admin. Jun 11, 2015
@@ -0,0 +1,103 @@
# -*- coding: utf-8 -*-
import datetime
from south.db import db
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the timeline on moving basket to django 1.7+ with the new style of migrations?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As soon as I can get someone in IT to get basket on the new Python 2.7 generic cluster. We're still on 2.6 😞

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<insert "funny" animated gif of ancient python playing a sad trombone here>

@jgmize
Copy link

jgmize commented Jun 11, 2015

This is going to be a really tiny table, isn't it? All of the caching code feels like it might be a premature optimization. You have more experience with the performance of this system, and you seem to have all the cases covered w.r.t. cache invalidation with the post_save and post_delete signal handlers, so you've already paid the complexity penalty in the initial implementation, but there's still the maintenance burden to consider if you'd rather simplify the code by eliminating the cache logic.



CACHE_KEY = "newsletters_cache_data"
SMS_CACHE_KEY = "sms_messages_cache_data"
SMS_MESSAGES = {
'SMS_Android': 'MTo3ODow',
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this hard coded here instead of in the new DB model?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just already had that and I'll likely remove it later. It's only really necessary when this first rolls out to avoid any dropped requests. I could do a data migration as well, but this just seemed easier based on what was already there.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha. Might be worth adding a comment, up to you.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Adding a TODO now.

@pmclanahan
Copy link
Author

Yeah. Could probably have done without cache, but this is called for every message request, and those will be in spikes, so since I basically already had the logic working for the newsletter data I figured I'd just be safer than sorry.

In ET the ID of an SMS message we need to send them
changes when you edit it. So we need to be able to
update these easily.
@pmclanahan
Copy link
Author

Added TODOs. Any more fixing up needed?

@jgmize
Copy link

jgmize commented Jun 12, 2015

Any more fixing up needed?

Nope, r+!

jgmize added a commit that referenced this pull request Jun 12, 2015
Fix bug 1173780: Add SMS message id admin.
@jgmize jgmize merged commit 8573515 into mozilla:master Jun 12, 2015
@pmclanahan pmclanahan deleted the add-admin-sms-ids branch June 12, 2015 02:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants