From f2d01e422922fa5599dd287ddce497b043142a98 Mon Sep 17 00:00:00 2001 From: Dmitriy Shesterkin Date: Mon, 26 Jun 2017 19:23:48 +0300 Subject: [PATCH] fix path --- src/commons/tests.py | 16 ------------- src/customer/tests.py | 16 ------------- src/customer/utils.py | 21 +++++++++--------- src/customer/views/profile.py | 2 +- src/dokumentor/settings/common.py | 2 +- src/dokumentor/wsgi.py | 2 +- src/myauth/emails.py | 12 +++++----- .../{myauth => emails}/license_activated.txt | 0 .../{myauth => emails}/license_ended.txt | 0 templates/{myauth => emails}/license_ends.txt | 0 .../{myauth => emails}/license_to_pay.txt | 0 .../{myauth => emails}/registration_email.txt | 0 .../{myauth => emails}/reset_key_email.txt | 0 .../reset_new_password_email.txt | 0 templates/xls/4pd.xls | Bin 35840 -> 35840 bytes 15 files changed, 20 insertions(+), 51 deletions(-) delete mode 100644 src/commons/tests.py delete mode 100644 src/customer/tests.py rename templates/{myauth => emails}/license_activated.txt (100%) rename templates/{myauth => emails}/license_ended.txt (100%) rename templates/{myauth => emails}/license_ends.txt (100%) rename templates/{myauth => emails}/license_to_pay.txt (100%) rename templates/{myauth => emails}/registration_email.txt (100%) rename templates/{myauth => emails}/reset_key_email.txt (100%) rename templates/{myauth => emails}/reset_new_password_email.txt (100%) diff --git a/src/commons/tests.py b/src/commons/tests.py deleted file mode 100644 index 501deb7..0000000 --- a/src/commons/tests.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -This file demonstrates writing tests using the unittest module. These will pass -when you run "manage.py test". - -Replace this with more appropriate tests for your application. -""" - -from django.test import TestCase - - -class SimpleTest(TestCase): - def test_basic_addition(self): - """ - Tests that 1 + 1 always equals 2. - """ - self.assertEqual(1 + 1, 2) diff --git a/src/customer/tests.py b/src/customer/tests.py deleted file mode 100644 index 501deb7..0000000 --- a/src/customer/tests.py +++ /dev/null @@ -1,16 +0,0 @@ -""" -This file demonstrates writing tests using the unittest module. These will pass -when you run "manage.py test". - -Replace this with more appropriate tests for your application. -""" - -from django.test import TestCase - - -class SimpleTest(TestCase): - def test_basic_addition(self): - """ - Tests that 1 + 1 always equals 2. - """ - self.assertEqual(1 + 1, 2) diff --git a/src/customer/utils.py b/src/customer/utils.py index 8b348e7..da24e9a 100644 --- a/src/customer/utils.py +++ b/src/customer/utils.py @@ -24,8 +24,8 @@ def check_one_profile(profile, License, now, manual=False): user_email = profile.users.get().email if profile.active and not profile_is_active: - template_name = 'myauth/license_activated.txt' - subject = u'Документор: Профиль активирован' + template_name = 'emails/license_activated.txt' + subject = 'Документор: Профиль активирован' dict_context = {'user_email': user_email, 'support_email': SUPPORT_EMAIL, 'license_starts': licenses[0].date_from, @@ -45,8 +45,8 @@ def check_one_profile(profile, License, now, manual=False): licenses.update(status=3) if licenses: - template_name = 'myauth/license_ended.txt' - subject = u'Документор: срок действия лицензии окончен' + template_name = 'emails/license_ended.txt' + subject = 'Документор: срок действия лицензии окончен' dict_context = {'user_email': user_email, 'support_email': SUPPORT_EMAIL, 'license_ends': licenses[0].date_to, @@ -60,8 +60,8 @@ def check_one_profile(profile, License, now, manual=False): status__in=[-1, 2], deleted=False) if licenses: - template_name = 'myauth/license_ends.txt' - subject = u'Документор: окончание срока действия лицензии' + template_name = 'emails/license_ends.txt' + subject = 'Документор: окончание срока действия лицензии' dict_context = {'user_email': user_email, 'support_email': SUPPORT_EMAIL, 'license_ends': licenses[0].date_to, @@ -76,8 +76,8 @@ def check_one_profile(profile, License, now, manual=False): status=0, deleted=False) if licenses: - template_name = 'myauth/license_to_pay.txt' - subject = u'Документор: есть неоплаченные счета' + template_name = 'emails/license_to_pay.txt' + subject = 'Документор: есть неоплаченные счета' dict_context = {'user_email': user_email, 'support_email': SUPPORT_EMAIL, } @@ -88,5 +88,6 @@ def check_one_profile(profile, License, now, manual=False): def raise_if_no_profile(request): if not request.user.profile: - raise Exception(u"Profile not found for user: %d, '%s'" % - (request.user.pk, request.user.username)) + raise Exception( + f"Profile not found for user: {request.user.pk}, '{request.user.username}'" + ) diff --git a/src/customer/views/profile.py b/src/customer/views/profile.py index bda9d61..e28b995 100644 --- a/src/customer/views/profile.py +++ b/src/customer/views/profile.py @@ -288,7 +288,7 @@ def profile_email(request): form = form_class(data=request.POST) if form.is_valid(): _send_profile_email( - subject=u'Реквизиты %s' % profile.get_company_name(), + subject='Реквизиты %s' % profile.get_company_name(), to=form.cleaned_data['to'], body=form.cleaned_data['body'], pdf_content=_profile_get_pdf(request, profile, filters.bank_account, filters) diff --git a/src/dokumentor/settings/common.py b/src/dokumentor/settings/common.py index 4819554..b116165 100644 --- a/src/dokumentor/settings/common.py +++ b/src/dokumentor/settings/common.py @@ -120,7 +120,7 @@ TEMPLATES = [ }, ] -ROOT_URLCONF = 'dokumentor.urls' +ROOT_URLCONF = 'src.dokumentor.urls' # Python dotted path to the WSGI application used by Django's runserver. WSGI_APPLICATION = 'wsgi.application' diff --git a/src/dokumentor/wsgi.py b/src/dokumentor/wsgi.py index e010a64..293e28c 100644 --- a/src/dokumentor/wsgi.py +++ b/src/dokumentor/wsgi.py @@ -1,5 +1,5 @@ import os -os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dokumentor.settings") +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "src.dokumentor.settings") from django.core.wsgi import get_wsgi_application # noqa diff --git a/src/myauth/emails.py b/src/myauth/emails.py index daa5a6c..484738d 100644 --- a/src/myauth/emails.py +++ b/src/myauth/emails.py @@ -11,8 +11,8 @@ SUPPORT_EMAIL = getattr(settings, 'SUPPORT_EMAIL', '') @task def send_registration_email(user_email, confirm_url): """Отправить письмо о регистрации нового пользователя.""" - template_name = 'myauth/registration_email.txt' - subject = u'Регистрация на Документоре: подтверждение e-mail' + template_name = 'emails/registration_email.txt' + subject = 'Регистрация на Документоре: подтверждение e-mail' dict_context = { 'user_email': user_email, 'confirm_url': confirm_url, @@ -26,8 +26,8 @@ def send_registration_email(user_email, confirm_url): @task def send_reset_password_email(user_email, confirm_url): """Отправить письмо с ключём для восстановления пароля.""" - template_name = 'myauth/reset_key_email.txt' - subject = u'Документор: восстановление пароля' + template_name = 'emails/reset_key_email.txt' + subject = 'Документор: восстановление пароля' dict_context = { 'user_email': user_email, 'confirm_url': confirm_url, @@ -41,8 +41,8 @@ def send_reset_password_email(user_email, confirm_url): @task def send_new_password_email(user_email, new_password): """Отправить письмо с новым паролем.""" - template_name = 'myauth/reset_new_password_email.txt' - subject = u'Документор: новый пароль' + template_name = 'emails/reset_new_password_email.txt' + subject = 'Документор: новый пароль' dict_context = { 'user_email': user_email, 'new_password': new_password, diff --git a/templates/myauth/license_activated.txt b/templates/emails/license_activated.txt similarity index 100% rename from templates/myauth/license_activated.txt rename to templates/emails/license_activated.txt diff --git a/templates/myauth/license_ended.txt b/templates/emails/license_ended.txt similarity index 100% rename from templates/myauth/license_ended.txt rename to templates/emails/license_ended.txt diff --git a/templates/myauth/license_ends.txt b/templates/emails/license_ends.txt similarity index 100% rename from templates/myauth/license_ends.txt rename to templates/emails/license_ends.txt diff --git a/templates/myauth/license_to_pay.txt b/templates/emails/license_to_pay.txt similarity index 100% rename from templates/myauth/license_to_pay.txt rename to templates/emails/license_to_pay.txt diff --git a/templates/myauth/registration_email.txt b/templates/emails/registration_email.txt similarity index 100% rename from templates/myauth/registration_email.txt rename to templates/emails/registration_email.txt diff --git a/templates/myauth/reset_key_email.txt b/templates/emails/reset_key_email.txt similarity index 100% rename from templates/myauth/reset_key_email.txt rename to templates/emails/reset_key_email.txt diff --git a/templates/myauth/reset_new_password_email.txt b/templates/emails/reset_new_password_email.txt similarity index 100% rename from templates/myauth/reset_new_password_email.txt rename to templates/emails/reset_new_password_email.txt diff --git a/templates/xls/4pd.xls b/templates/xls/4pd.xls index 38cd2872de0e5ac1bb074c9a38b1554441a5631e..e80d8f883ae83e59d027924c1ac47c58696b91f4 100644 GIT binary patch delta 65 zcmZpe!PGE=X@drnj4T7AJ&PTSHH#06IgmDDF<^0GF$MD#CYQS?O*UdO+B}2lN;}7b RVgcVN?=CTJF6ruF1OVN@5sm-= delta 47 ycmZpe!PGE=X@dq6I|~CtVqQw+