Skip to content

Commit

Permalink
Merge pull request #2645 from carpentries/feature/2643-new-email-host…
Browse files Browse the repository at this point in the history
…-intructors-introduction

[Emails] New email host intructors introduction
  • Loading branch information
pbanaszkiewicz committed May 18, 2024
2 parents db8b8be + 6994991 commit 2a539e4
Show file tree
Hide file tree
Showing 34 changed files with 2,248 additions and 488 deletions.
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ django-anymail = "~=8.4"
django-contrib-comments = "~=2.2.0"
django-countries = "~=7.6.1"
django-crispy-forms = "~=1.13.0"
django-debug-toolbar = "~=3.2.2"
django-debug-toolbar = "~=4.3"
django-environ = "~=0.9.0"
django-extensions = "~=3.2.3"
django-filter = "~=22.1"
Expand Down
290 changes: 141 additions & 149 deletions Pipfile.lock

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions amy/emails/actions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
from emails.actions.admin_signs_instructor_up_for_workshop import (
admin_signs_instructor_up_for_workshop_receiver,
)
from emails.actions.host_instructors_introduction import (
host_instructors_introduction_receiver,
host_instructors_introduction_remove_receiver,
host_instructors_introduction_update_receiver,
)
from emails.actions.instructor_badge_awarded import instructor_badge_awarded_receiver
from emails.actions.instructor_confirmed_for_workshop import (
instructor_confirmed_for_workshop_receiver,
Expand Down
10 changes: 4 additions & 6 deletions amy/emails/actions/admin_signs_instructor_up_for_workshop.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,14 @@ def get_context(
"instructor_recruitment_signup": instructor_recruitment_signup,
}

def get_context_json(
self, **kwargs: Unpack[AdminSignsInstructorUpKwargs]
) -> ContextModel:
def get_context_json(self, context: AdminSignsInstructorUpContext) -> ContextModel:
return ContextModel(
{
"person": api_model_url("person", kwargs["person_id"]),
"event": api_model_url("event", kwargs["event_id"]),
"person": api_model_url("person", context["person"].pk),
"event": api_model_url("event", context["event"].pk),
"instructor_recruitment_signup": api_model_url(
"instructorrecruitmentsignup",
kwargs["instructor_recruitment_signup_id"],
context["instructor_recruitment_signup"].pk,
),
},
)
Expand Down
6 changes: 3 additions & 3 deletions amy/emails/actions/base_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def get_context(self, **kwargs) -> dict[str, Any]:
raise NotImplementedError()

@abstractmethod
def get_context_json(self, **kwargs) -> ContextModel:
def get_context_json(self, context: dict[str, Any]) -> ContextModel:
raise NotImplementedError()

@abstractmethod
Expand All @@ -79,7 +79,7 @@ def __call__(self, sender: Any, **kwargs) -> None:
request = kwargs.pop("request")

context = self.get_context(**kwargs)
context_json = self.get_context_json(**kwargs)
context_json = self.get_context_json(context)
scheduled_at = self.get_scheduled_at(**kwargs)

try:
Expand Down Expand Up @@ -114,7 +114,7 @@ def __call__(self, sender: Any, **kwargs) -> None:
request = kwargs.pop("request")

context = self.get_context(**kwargs)
context_json = self.get_context_json(**kwargs)
context_json = self.get_context_json(context)
scheduled_at = self.get_scheduled_at(**kwargs)
generic_relation_obj = self.get_generic_relation_object(context, **kwargs)
signal_name = self.signal
Expand Down
Loading

0 comments on commit 2a539e4

Please sign in to comment.