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

Fix bug 1138531: Add an email block list feature. #134

Merged
merged 1 commit into from
Mar 3, 2015

Conversation

pmclanahan
Copy link

No description provided.

@pmclanahan
Copy link
Author

@jgmize r?

cache_key = 'email_block_list'
block_list = email_block_list_cache.get(cache_key)
if block_list is None:
block_list = BlockedEmail.objects.values_list('email_domain', flat=True)
Copy link

Choose a reason for hiding this comment

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

micro-optimization nit: I would go ahead and convert this to an actual list-- no point in pickling/unpickling the queryset object itself. Since you're using LocMemCache the performance impact will be negligible, so not a blocker, but it will help if you ever switch to memcache or redis because you'll be sending less data over the wire.

Copy link
Author

Choose a reason for hiding this comment

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

Huh... yeah. Good call. I was just wrong and thought that when flat=True was passed it returned a list object.

@jgmize
Copy link

jgmize commented Mar 3, 2015

r+, nice work.

@pmclanahan pmclanahan merged commit b9c8b48 into mozilla:master Mar 3, 2015
@pmclanahan pmclanahan deleted the add-block-list-1138531 branch March 3, 2015 21:51
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