From 5e134fb5170ece068d22d033cbe773566613b600 Mon Sep 17 00:00:00 2001 From: Mukhtar Date: Mon, 29 Aug 2016 20:04:03 +0300 Subject: [PATCH] #ARC-23 add noreply setttings --- .../migrations/0006_settings_noreply_email.py | 20 +++++++++++++++++++ common/models.py | 2 +- common/views.py | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 common/migrations/0006_settings_noreply_email.py diff --git a/common/migrations/0006_settings_noreply_email.py b/common/migrations/0006_settings_noreply_email.py new file mode 100644 index 0000000..ed85d68 --- /dev/null +++ b/common/migrations/0006_settings_noreply_email.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.7 on 2016-08-29 16:59 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('common', '0005_settings_accountant_send_email'), + ] + + operations = [ + migrations.AddField( + model_name='settings', + name='noreply_email', + field=models.CharField(default='noreply@proekton.com', max_length=50), + ), + ] diff --git a/common/models.py b/common/models.py index 61edfd9..6559cdc 100644 --- a/common/models.py +++ b/common/models.py @@ -43,7 +43,7 @@ class Settings(models.Model): document_send_time_remove = models.IntegerField(default=14) recalculation_spec_time = models.TimeField() recalculation_rating_time = models.TimeField() - # worksell_count = models.PositiveIntegerField(default=20) + noreply_email = models.CharField(max_length=50,default='noreply@proekton.com') def __str__(self): return 'Настройки сайта' diff --git a/common/views.py b/common/views.py index b5b3865..1729bb3 100644 --- a/common/views.py +++ b/common/views.py @@ -52,7 +52,7 @@ class PrintDocumentCreate(BaseMixin, View): settings = Settings.objects.all().first() - subject, from_email, to = 'Заявка на распечатку', 'mukhtar@mukhtar', settings.document_send_email + subject, from_email, to = 'Заявка на распечатку', settings.noreply_email, settings.document_send_email text_content = render_to_string('document_email.txt', ctx_dict) html_content = get_template('document_email.html').render(ctx_dict) msg = EmailMultiAlternatives(subject, text_content, from_email, [to])