done last commit before merging - fixed media URLSs S3

This commit is contained in:
2026-06-12 00:56:01 +02:00
parent f4c4a8bfd1
commit 44e77e7744
19 changed files with 1478 additions and 193 deletions

View File

@@ -39,6 +39,50 @@ def send_email_verification_task(user_id):
)
@shared_task
def send_email_change_verification_task(user_id, new_email, verify_url):
"""Sends confirmation link to the NEW email address."""
from notifications.tasks import send_email_with_context
try:
user = CustomUser.objects.get(pk=user_id)
except CustomUser.DoesNotExist:
return
send_email_with_context(
recipients=new_email,
subject="Potvrzení změny e-mailu — vontor.cz",
template_path="email/action_confirm.html",
context={
"title": "Potvrďte novou e-mailovou adresu",
"description": f"Obdrželi jsme žádost o změnu e-mailové adresy na účtu <strong>{user.username}</strong>. Klikněte na tlačítko níže pro potvrzení.",
"action_url": verify_url,
"cta_label": "Potvrdit nový e-mail",
"note": "Pokud jste tuto změnu nepožadovali, ignorujte tento e-mail — vaše stávající adresa zůstane aktivní.",
},
)
@shared_task
def send_email_change_notification_task(user_id, old_email, new_email):
"""Notifies the OLD email address that a change was requested."""
from notifications.tasks import send_email_with_context
try:
user = CustomUser.objects.get(pk=user_id)
except CustomUser.DoesNotExist:
return
send_email_with_context(
recipients=old_email,
subject="Žádost o změnu e-mailu — vontor.cz",
template_path="email/action_confirm.html",
context={
"title": "Vaše e-mailová adresa se mění",
"description": f"Na účtu <strong>{user.username}</strong> byla zahájena změna e-mailové adresy na <strong>{new_email}</strong>.",
"action_url": None,
"cta_label": None,
"note": "Pokud jste tuto akci nespustili, okamžitě kontaktujte podporu. Změna vstoupí v platnost až po potvrzení z nové adresy.",
},
)
@shared_task
def send_email_test_task(email):
send_email_with_context(