Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandreJunod committed Aug 17, 2023
1 parent 551b6cb commit 264c3bb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion geocity/apps/reports/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,8 @@ class Meta:
verbose_name = _("Destinataire")

def _get_recipient(self, request, base_context):
from geocity.apps.submissions.models import ContactType

properties = base_context["request_data"]["properties"]
contacts = properties["contacts"]

Expand All @@ -737,8 +739,10 @@ def _get_recipient(self, request, base_context):
# Empty string, if nothing is found, it won't return anything from json and will let empty the section instead of crashing
selected_recipient = ""

author = ContactType.objects.get(name="Auteur")

for recipient in recipients:
if recipient.name == "Auteur" and "author" in properties:
if recipient == author and "author" in properties:
selected_recipient = properties["author"]
elif contacts:
for contact in contacts.values():
Expand Down

0 comments on commit 264c3bb

Please sign in to comment.