Skip to content

Commit b8c4532

Browse files
committed
🩹(template) remove pylint disable
Follow best practice to not use mutable default value as an argument
1 parent e63e635 commit b8c4532

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎src/backend/core/models.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
22
Declare and configure the models for the messages core application
33
"""
4-
# pylint: disable=too-many-lines,too-many-instance-attributes,dangerous-default-value
4+
# pylint: disable=too-many-lines,too-many-instance-attributes
55

66
import base64
77
import hashlib
@@ -1825,7 +1825,7 @@ def render_template(
18251825
self,
18261826
mailbox: Mailbox = None,
18271827
user: User = None,
1828-
context: Dict[str, Any] = {}, # noqa: B006
1828+
context: Optional[Dict[str, Any]] = None,
18291829
) -> Dict[str, str]:
18301830
"""
18311831
Render the template with the given context.
@@ -1837,7 +1837,7 @@ def render_template(
18371837
Returns:
18381838
Dictionary with 'html_body' and 'text_body' keys containing rendered content
18391839
"""
1840-
context = context.copy()
1840+
context = context.copy() if context else {}
18411841
context["name"] = (
18421842
mailbox.contact.name
18431843
if mailbox and mailbox.contact

0 commit comments

Comments
 (0)