Новый дизайн грамот для пользователей

remotes/origin/feature/landing-registration
gzbender 6 years ago
parent d08fe1be3f
commit b2e326b662
  1. 13
      apps/notification/tasks.py
  2. 2
      project/settings.py
  3. 0
      resources/signed-user-certificates/1.jpg
  4. 0
      resources/signed-user-certificates/2.jpg
  5. 0
      resources/signed-user-certificates/3.jpg
  6. 0
      resources/signed-user-certificates/4.jpg
  7. 0
      resources/signed-user-certificates/5.jpg
  8. 0
      resources/signed-user-certificates/6.jpg
  9. 0
      resources/signed-user-certificates/7.jpg
  10. 0
      resources/signed-user-certificates/8.jpg
  11. 0
      resources/signed-user-certificates/9.jpg
  12. BIN
      web/src/img/user-certificates/1.jpg
  13. BIN
      web/src/img/user-certificates/2.jpg
  14. BIN
      web/src/img/user-certificates/3.jpg
  15. BIN
      web/src/img/user-certificates/4.jpg
  16. BIN
      web/src/img/user-certificates/5.jpg
  17. BIN
      web/src/img/user-certificates/6.jpg
  18. BIN
      web/src/img/user-certificates/7.jpg
  19. BIN
      web/src/img/user-certificates/8.jpg
  20. BIN
      web/src/img/user-certificates/9.jpg

@ -50,10 +50,10 @@ def draw_cert(path, email, first_name, last_name, x=None, y=900, color=(29, 115,
@app.task @app.task
def send_certificates(email=None, date_end=None, dry_run=False): def send_certificates(email=None, date_end=None, dry_run=False):
path_pattern = 'img/user-certificates/%d.jpg' path_pattern = 'user-certificates/%d.jpg'
signed_path_pattern = 'img/signed-user-certificates/%d.jpg' signed_path_pattern = 'signed-user-certificates/%d.jpg'
if email: if email:
fn = draw_cert(staticfiles_storage.path(signed_path_pattern % 1), email, 'Имя', 'Фамилия') fn = draw_cert(os.path.join(settings.RESOURCES_ROOT, signed_path_pattern % 1), email, 'Имя', 'Фамилия')
file = open(fn, 'rb') file = open(fn, 'rb')
try: try:
send_email('Грамота от Lil School', email, 'notification/email/certificate.html', send_email('Грамота от Lil School', email, 'notification/email/certificate.html',
@ -85,14 +85,15 @@ def send_certificates(email=None, date_end=None, dry_run=False):
file_names = [] file_names = []
un.certificate_number = un.certificate_number + 1 \ un.certificate_number = un.certificate_number + 1 \
if un.certificate_number and staticfiles_storage.exists(path_pattern % (un.certificate_number + 1)) \ if un.certificate_number and os.path.isfile(os.path.join(settings.RESOURCES_ROOT,
path_pattern % (un.certificate_number + 1))) \
else 1 else 1
if un.user.child_filled: if un.user.child_filled:
fn = staticfiles_storage.path(signed_path_pattern % un.certificate_number) fn = os.path.join(settings.RESOURCES_ROOT, signed_path_pattern % un.certificate_number)
for child in un.user.childs.all(): for child in un.user.childs.all():
file_names.append(draw_cert(fn, un.user.email, child.first_name, child.last_name)) file_names.append(draw_cert(fn, un.user.email, child.first_name, child.last_name))
else: else:
file_names.append(staticfiles_storage.path(signed_path_pattern % un.certificate_number)) file_names.append(os.path.join(settings.RESOURCES_ROOT, signed_path_pattern % un.certificate_number))
files = [open(fn, 'rb') for fn in file_names] files = [open(fn, 'rb') for fn in file_names]
try: try:
send_email('Грамота от Lil School', un.user.email, 'notification/email/certificate.html', send_email('Грамота от Lil School', un.user.email, 'notification/email/certificate.html',

@ -329,7 +329,7 @@ CELERY_BEAT_SCHEDULE = {
}, },
'send_certificates': { 'send_certificates': {
'task': 'apps.notification.tasks.send_certificates', 'task': 'apps.notification.tasks.send_certificates',
'schedule': crontab(minute=0, hour=19), 'schedule': crontab(minute=30, hour=19),
'args': (), 'args': (),
}, },
'sendgrid_update_recipients': { 'sendgrid_update_recipients': {

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 1.3 MiB

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 1.2 MiB

Before

Width:  |  Height:  |  Size: 987 KiB

After

Width:  |  Height:  |  Size: 987 KiB

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 1.2 MiB

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 1.3 MiB

Before

Width:  |  Height:  |  Size: 1.5 MiB

After

Width:  |  Height:  |  Size: 1.5 MiB

Before

Width:  |  Height:  |  Size: 1.6 MiB

After

Width:  |  Height:  |  Size: 1.6 MiB

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

Loading…
Cancel
Save