Skip to content

Commit

Permalink
Hotfix: siae_user.full_name in Siae completion reminder task. ref #753
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn committed May 30, 2023
1 parent b313905 commit 465d443
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import calendar

from django.core.management.base import BaseCommand, CommandError
from django.core.management.base import CommandError
from django.utils import timezone

from lemarche.siaes.models import Siae
from lemarche.siaes.tasks import send_completion_reminder_email_to_siae
from lemarche.utils.apis import api_slack
from lemarche.utils.commands import BaseCommand


class Command(BaseCommand):
Expand Down
4 changes: 2 additions & 2 deletions lemarche/siaes/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ def set_siae_coords(model, siae):

def send_completion_reminder_email_to_siae(siae):
email_subject = "Vous avez raté des opportunités commerciales !"
siae_user_emails = siae.users.values_list("email", flat=True)
siae_user_emails = list(siae.users.values_list("email", flat=True))
recipient_list = whitelist_recipient_list(siae_user_emails)
if recipient_list:
for siae_user_email in recipient_list:
siae_user = User.objects.get(email=siae_user_email).first_name
siae_user = User.objects.get(email=siae_user_email)
recipient_name = siae_user.full_name

variables = {
Expand Down

0 comments on commit 465d443

Please sign in to comment.