Skip to content
Snippets Groups Projects
Commit ed013ff6 authored by florimondmanca's avatar florimondmanca
Browse files

fix projets notifications recipients

parent 7daae7ac
No related branches found
No related tags found
1 merge request!4Release version ready to welcome first users
...@@ -33,7 +33,7 @@ class _NotifyOrgnizers(_BaseParticipationNotification): ...@@ -33,7 +33,7 @@ class _NotifyOrgnizers(_BaseParticipationNotification):
"""Return the email of each organizer.""" """Return the email of each organizer."""
edition = self.kwargs['edition'] edition = self.kwargs['edition']
# TODO add the project team's email # TODO add the project team's email
return list(edition.values_list('organizers__email', flat=True)) return list(edition.organizers.values_list('email', flat=True))
class _NotifyUser(_BaseParticipationNotification): class _NotifyUser(_BaseParticipationNotification):
......
...@@ -8,7 +8,7 @@ from dynamicforms.models import Form ...@@ -8,7 +8,7 @@ from dynamicforms.models import Form
from profiles.factory import TutorFactory from profiles.factory import TutorFactory
from projects.factory import (EditionFactory, ParticipationFactory, from projects.factory import (EditionFactory, ParticipationFactory,
ProjectFactory) ProjectFactory)
from projects.models import EditionForm, Participation from projects.models import EditionForm, Participation, EditionOrganizer
from projects.signals import (accepted, cancelled, deleted, pending, rejected, from projects.signals import (accepted, cancelled, deleted, pending, rejected,
valid) valid)
...@@ -19,8 +19,11 @@ class NotifyParticipationTest(SignalTestMixin, TestCase): ...@@ -19,8 +19,11 @@ class NotifyParticipationTest(SignalTestMixin, TestCase):
def setUp(self): def setUp(self):
# Create all objects that need to exist for rendering emails # Create all objects that need to exist for rendering emails
project = ProjectFactory.create(name='Focus Europe') project = ProjectFactory.create(name='Focus Europe')
self.edition = EditionFactory.create(project=project, year=2018)
recipient = TutorFactory.create() recipient = TutorFactory.create()
self.edition = EditionFactory.create(project=project, year=2018)
EditionOrganizer.objects.create(
user=recipient.user,
edition=self.edition)
form = Form.objects.create(title=f'Inscriptions à {self.edition}') form = Form.objects.create(title=f'Inscriptions à {self.edition}')
EditionForm.objects.create( EditionForm.objects.create(
edition=self.edition, edition=self.edition,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment