Refactor default handling of dict parameter
This commit is contained in:
parent
56e454cc8b
commit
31af4e933f
|
|
@ -65,7 +65,7 @@ class NotificationService:
|
|||
course: str,
|
||||
target_url: str,
|
||||
email_template: EmailTemplate,
|
||||
template_data: dict = {},
|
||||
template_data: dict = None,
|
||||
) -> None:
|
||||
cls._send_notification(
|
||||
recipient=recipient,
|
||||
|
|
@ -86,7 +86,7 @@ class NotificationService:
|
|||
course: str,
|
||||
target_url: str,
|
||||
email_template: EmailTemplate,
|
||||
template_data: dict = {},
|
||||
template_data: dict = None,
|
||||
) -> None:
|
||||
cls._send_notification(
|
||||
recipient=recipient,
|
||||
|
|
@ -105,7 +105,7 @@ class NotificationService:
|
|||
verb: str,
|
||||
target_url: str,
|
||||
email_template: EmailTemplate,
|
||||
template_data: dict = {},
|
||||
template_data: dict = None,
|
||||
) -> None:
|
||||
cls._send_notification(
|
||||
recipient=recipient,
|
||||
|
|
@ -123,11 +123,14 @@ class NotificationService:
|
|||
verb: str,
|
||||
notification_type: NotificationType,
|
||||
email_template: EmailTemplate,
|
||||
template_data: dict,
|
||||
template_data: dict | None = None,
|
||||
sender: User | None = None,
|
||||
course: str | None = None,
|
||||
target_url: str | None = None,
|
||||
) -> None:
|
||||
if template_data is None:
|
||||
template_data = {}
|
||||
|
||||
actor_avatar_url: Optional[str] = None
|
||||
if not sender:
|
||||
sender = User.objects.get(email="admin")
|
||||
|
|
|
|||
Loading…
Reference in New Issue