забрал фиксы с продакшина для рассыльщика

remotes/origin/stage5
Alexander Burdeiny 9 years ago
parent 427469edfc
commit ac7005bb34
  1. 8
      emencia/django/newsletter/mailer.py
  2. 4
      emencia/django/newsletter/models.py

@ -320,7 +320,7 @@ class NewsLetterSender(object):
return smart_unicode(content)
def build_preheader_ctx(self, contact):
t_add = ''
t_add = u''
count = contact.contactsettings.theme.count()
if count > 3:
count -= 3
@ -331,7 +331,7 @@ class NewsLetterSender(object):
)
self.preheader_ctx = {
'name': contact.first_name or contact.last_name or _(u'Подписчик'),
'themes': ', '.join([self.themes.get(x) for x in contact.contactsettings.theme.all().values_list('pk', flat=True)[:3]]) + t_add,
'themes': u', '.join([self.themes.get(x) for x in contact.contactsettings.theme.all().values_list('pk', flat=True)[:3]]) + t_add,
}
def update_newsletter_status(self):
@ -478,7 +478,7 @@ class Mailer(NewsLetterSender):
if self.announce and not announce_context:
send = False
try:
log.info('Trying send to {email}'.format(email=contact.email))
log.info(u'Trying send to {email}'.format(email=contact.email))
# pass
if send:
message = self.build_message(contact, announce_context)
@ -487,7 +487,7 @@ class Mailer(NewsLetterSender):
message.as_string())
except (Exception, ) as e:
exception = e
log.info('Exception was raised while sending to {email}: {exception}'.format(
log.info(u'Exception was raised while sending to {email}: {exception}'.format(
email=contact.email, exception=exception))
else:
exception = None

@ -206,9 +206,9 @@ class Contact(models.Model):
'conf': conf,
}
if expo:
context['expo_places'] = ', '.join(set([x.country.inflect for x in expo]))
context['expo_places'] = u', '.join(set([x.country.inflect for x in expo]))
if conf:
context['conf_places'] = ', '.join(set([x.country.inflect for x in conf]))
context['conf_places'] = u', '.join(set([x.country.inflect for x in conf]))
else:
# no events for announce
return None

Loading…
Cancel
Save