From 8020fb21042778d8d7045c19da5ac2ed5c34b431 Mon Sep 17 00:00:00 2001 From: Alexander Burdeiny Date: Tue, 18 Oct 2016 03:00:32 +0300 Subject: [PATCH] mailer fix --- emencia/django/newsletter/mailer.py | 2 +- fabfile.py | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/emencia/django/newsletter/mailer.py b/emencia/django/newsletter/mailer.py index e7b4ba89..4ac048db 100644 --- a/emencia/django/newsletter/mailer.py +++ b/emencia/django/newsletter/mailer.py @@ -241,7 +241,7 @@ class NewsLetterSender(object): _section = context.get(section) if _section: for event in _section: - prefix = '{}_{}_'.format(_section, event.object.event_type) + prefix = '{}_{}_'.format(section, event.object.event_type) msg_attachment = self.gen_attachment_logo(event.object, prefix) if msg_attachment: attachments.append(msg_attachment) diff --git a/fabfile.py b/fabfile.py index 8e4de901..236e03a1 100644 --- a/fabfile.py +++ b/fabfile.py @@ -96,6 +96,15 @@ def put_configs(): settings_conf) +def newsletters_media(): + with cd(join(REMOTE_HOME_DIR, 'media')): + run('mkdir -p newsletter') + put( + join(LOCAL_HOME_DIR, 'media/newsletter'), + join(REMOTE_HOME_DIR, 'media') + ) + + def call_state(state, only=None): if only is not None and only in services: run('service {only} {state}'.format(only=only, state=state))