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