Skip to content

Commit

Permalink
[#2695] Update trigger for the host-instructor introduction
Browse files Browse the repository at this point in the history
When recruitment is opened or closed, the strategy for host-instructor introduction is run.
  • Loading branch information
pbanaszkiewicz committed Sep 15, 2024
1 parent c0db42c commit 7610d13
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions amy/recruitment/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
import django_rq
from flags.views import FlaggedViewMixin

from emails.actions.host_instructors_introduction import (
host_instructors_introduction_strategy,
run_host_instructors_introduction_strategy,
)
from emails.signals import (
admin_signs_instructor_up_for_workshop_signal,
instructor_confirmed_for_workshop_signal,
Expand Down Expand Up @@ -522,6 +526,12 @@ def close_recruitment(self) -> HttpResponse:
f"Successfully closed recruitment {self.object}.",
)

run_host_instructors_introduction_strategy(
host_instructors_introduction_strategy(self.object.event),
self.request,
self.object.event,
)

return HttpResponseRedirect(self.get_success_url())

@staticmethod
Expand All @@ -544,6 +554,12 @@ def reopen_recruitment(self) -> HttpResponse:
self.request, f"Successfully re-opened recruitment {self.object}."
)

run_host_instructors_introduction_strategy(
host_instructors_introduction_strategy(self.object.event),
self.request,
self.object.event,
)

return HttpResponseRedirect(self.get_success_url())

def form_valid(self, form: BaseForm) -> HttpResponse:
Expand Down

0 comments on commit 7610d13

Please sign in to comment.