prod
Dmitriy Shesterkin 9 years ago
parent a3cf8dab08
commit f2d01e4229
  1. 16
      src/commons/tests.py
  2. 16
      src/customer/tests.py
  3. 21
      src/customer/utils.py
  4. 2
      src/customer/views/profile.py
  5. 2
      src/dokumentor/settings/common.py
  6. 2
      src/dokumentor/wsgi.py
  7. 12
      src/myauth/emails.py
  8. 0
      templates/emails/license_activated.txt
  9. 0
      templates/emails/license_ended.txt
  10. 0
      templates/emails/license_ends.txt
  11. 0
      templates/emails/license_to_pay.txt
  12. 0
      templates/emails/registration_email.txt
  13. 0
      templates/emails/reset_key_email.txt
  14. 0
      templates/emails/reset_new_password_email.txt
  15. BIN
      templates/xls/4pd.xls

@ -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)

@ -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)

@ -24,8 +24,8 @@ def check_one_profile(profile, License, now, manual=False):
user_email = profile.users.get().email user_email = profile.users.get().email
if profile.active and not profile_is_active: if profile.active and not profile_is_active:
template_name = 'myauth/license_activated.txt' template_name = 'emails/license_activated.txt'
subject = u'Документор: Профиль активирован' subject = 'Документор: Профиль активирован'
dict_context = {'user_email': user_email, dict_context = {'user_email': user_email,
'support_email': SUPPORT_EMAIL, 'support_email': SUPPORT_EMAIL,
'license_starts': licenses[0].date_from, 'license_starts': licenses[0].date_from,
@ -45,8 +45,8 @@ def check_one_profile(profile, License, now, manual=False):
licenses.update(status=3) licenses.update(status=3)
if licenses: if licenses:
template_name = 'myauth/license_ended.txt' template_name = 'emails/license_ended.txt'
subject = u'Документор: срок действия лицензии окончен' subject = 'Документор: срок действия лицензии окончен'
dict_context = {'user_email': user_email, dict_context = {'user_email': user_email,
'support_email': SUPPORT_EMAIL, 'support_email': SUPPORT_EMAIL,
'license_ends': licenses[0].date_to, '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) status__in=[-1, 2], deleted=False)
if licenses: if licenses:
template_name = 'myauth/license_ends.txt' template_name = 'emails/license_ends.txt'
subject = u'Документор: окончание срока действия лицензии' subject = 'Документор: окончание срока действия лицензии'
dict_context = {'user_email': user_email, dict_context = {'user_email': user_email,
'support_email': SUPPORT_EMAIL, 'support_email': SUPPORT_EMAIL,
'license_ends': licenses[0].date_to, 'license_ends': licenses[0].date_to,
@ -76,8 +76,8 @@ def check_one_profile(profile, License, now, manual=False):
status=0, deleted=False) status=0, deleted=False)
if licenses: if licenses:
template_name = 'myauth/license_to_pay.txt' template_name = 'emails/license_to_pay.txt'
subject = u'Документор: есть неоплаченные счета' subject = 'Документор: есть неоплаченные счета'
dict_context = {'user_email': user_email, dict_context = {'user_email': user_email,
'support_email': SUPPORT_EMAIL, 'support_email': SUPPORT_EMAIL,
} }
@ -88,5 +88,6 @@ def check_one_profile(profile, License, now, manual=False):
def raise_if_no_profile(request): def raise_if_no_profile(request):
if not request.user.profile: if not request.user.profile:
raise Exception(u"Profile not found for user: %d, '%s'" % raise Exception(
(request.user.pk, request.user.username)) f"Profile not found for user: {request.user.pk}, '{request.user.username}'"
)

@ -288,7 +288,7 @@ def profile_email(request):
form = form_class(data=request.POST) form = form_class(data=request.POST)
if form.is_valid(): if form.is_valid():
_send_profile_email( _send_profile_email(
subject=u'Реквизиты %s' % profile.get_company_name(), subject='Реквизиты %s' % profile.get_company_name(),
to=form.cleaned_data['to'], to=form.cleaned_data['to'],
body=form.cleaned_data['body'], body=form.cleaned_data['body'],
pdf_content=_profile_get_pdf(request, profile, filters.bank_account, filters) pdf_content=_profile_get_pdf(request, profile, filters.bank_account, filters)

@ -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. # Python dotted path to the WSGI application used by Django's runserver.
WSGI_APPLICATION = 'wsgi.application' WSGI_APPLICATION = 'wsgi.application'

@ -1,5 +1,5 @@
import os 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 from django.core.wsgi import get_wsgi_application # noqa

@ -11,8 +11,8 @@ SUPPORT_EMAIL = getattr(settings, 'SUPPORT_EMAIL', '')
@task @task
def send_registration_email(user_email, confirm_url): def send_registration_email(user_email, confirm_url):
"""Отправить письмо о регистрации нового пользователя.""" """Отправить письмо о регистрации нового пользователя."""
template_name = 'myauth/registration_email.txt' template_name = 'emails/registration_email.txt'
subject = u'Регистрация на Документоре: подтверждение e-mail' subject = 'Регистрация на Документоре: подтверждение e-mail'
dict_context = { dict_context = {
'user_email': user_email, 'user_email': user_email,
'confirm_url': confirm_url, 'confirm_url': confirm_url,
@ -26,8 +26,8 @@ def send_registration_email(user_email, confirm_url):
@task @task
def send_reset_password_email(user_email, confirm_url): def send_reset_password_email(user_email, confirm_url):
"""Отправить письмо с ключём для восстановления пароля.""" """Отправить письмо с ключём для восстановления пароля."""
template_name = 'myauth/reset_key_email.txt' template_name = 'emails/reset_key_email.txt'
subject = u'Документор: восстановление пароля' subject = 'Документор: восстановление пароля'
dict_context = { dict_context = {
'user_email': user_email, 'user_email': user_email,
'confirm_url': confirm_url, 'confirm_url': confirm_url,
@ -41,8 +41,8 @@ def send_reset_password_email(user_email, confirm_url):
@task @task
def send_new_password_email(user_email, new_password): def send_new_password_email(user_email, new_password):
"""Отправить письмо с новым паролем.""" """Отправить письмо с новым паролем."""
template_name = 'myauth/reset_new_password_email.txt' template_name = 'emails/reset_new_password_email.txt'
subject = u'Документор: новый пароль' subject = 'Документор: новый пароль'
dict_context = { dict_context = {
'user_email': user_email, 'user_email': user_email,
'new_password': new_password, 'new_password': new_password,

Binary file not shown.
Loading…
Cancel
Save