|
|
|
|
@ -165,14 +165,17 @@ def send_child_birthday_email_and_bonuses(): |
|
|
|
|
@app.task |
|
|
|
|
def send_camp_certificates(email=None, dry_run=False, certificate_number=None): |
|
|
|
|
path_pattern = 'img/camp-certificates/%d.jpg' |
|
|
|
|
color = (35, 59, 227) |
|
|
|
|
signed_path_pattern = 'img/signed-camp-certificates/%d.jpg' |
|
|
|
|
color = (0, 27, 94) |
|
|
|
|
if certificate_number is None: |
|
|
|
|
certificate_number = 1 |
|
|
|
|
if certificate_number == 2: |
|
|
|
|
color = (0, 27, 94) |
|
|
|
|
color = (106, 5, 163) |
|
|
|
|
if certificate_number == 3: |
|
|
|
|
color = (24, 57, 220) |
|
|
|
|
if email: |
|
|
|
|
fn = draw_cert(staticfiles_storage.path(path_pattern % certificate_number), email, 'Имя', 'Фамилия', |
|
|
|
|
font_size=70, y=550, color=color) |
|
|
|
|
fn = draw_cert(staticfiles_storage.path(signed_path_pattern % certificate_number), email, 'Имя', 'Фамилия', |
|
|
|
|
font_size=120, y=1000, color=color) |
|
|
|
|
file = open(fn, 'rb') |
|
|
|
|
try: |
|
|
|
|
pass |
|
|
|
|
@ -203,9 +206,9 @@ def send_camp_certificates(email=None, dry_run=False, certificate_number=None): |
|
|
|
|
continue |
|
|
|
|
|
|
|
|
|
if un.user.child_first_name: |
|
|
|
|
fn = staticfiles_storage.path(path_pattern % certificate_number) |
|
|
|
|
fn = staticfiles_storage.path(signed_path_pattern % certificate_number) |
|
|
|
|
fn = draw_cert(fn, un.user.email, un.user.child_first_name, un.user.child_last_name, |
|
|
|
|
font_size=70, y=550, color=color) |
|
|
|
|
font_size=120, y=1000, color=color) |
|
|
|
|
else: |
|
|
|
|
fn = staticfiles_storage.path(path_pattern % certificate_number) |
|
|
|
|
file = open(fn, 'rb') |
|
|
|
|
|