Added prefetch optimize
This commit is contained in:
parent
d4e993abee
commit
241012da42
|
|
@ -20,7 +20,7 @@ def send_email_with_news(news_ids):
|
||||||
htmly = get_template(settings.NEWS_EMAIL_TEMPLATE)
|
htmly = get_template(settings.NEWS_EMAIL_TEMPLATE)
|
||||||
year = datetime.now().year
|
year = datetime.now().year
|
||||||
|
|
||||||
socials = list(SiteSettings.objects.with_country())
|
socials = list(SiteSettings.objects.with_country().select_related('country'))
|
||||||
socials = dict(zip(map(lambda social: social.country.code, socials), socials))
|
socials = dict(zip(map(lambda social: social.country.code, socials), socials))
|
||||||
|
|
||||||
for subscriber in subscribers:
|
for subscriber in subscribers:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user