Skip to content

Commit d7eccca

Browse files
[pre-commit.ci] pre-commit autoupdate (#152)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/psf/black: 23.12.1 → 24.1.1](psf/black@23.12.1...24.1.1) - [github.com/PyCQA/bandit: 1.7.6 → 1.7.7](PyCQA/bandit@1.7.6...1.7.7) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 08219d3 commit d7eccca

File tree

5 files changed

+15
-11
lines changed

5 files changed

+15
-11
lines changed

.pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ repos:
5555
additional_dependencies:
5656
- tomli
5757
- repo: https://github.com/psf/black
58-
rev: 23.12.1
58+
rev: 24.1.1
5959
hooks:
6060
- id: black
6161
- repo: https://github.com/pre-commit/mirrors-mypy
@@ -96,7 +96,7 @@ repos:
9696
additional_dependencies:
9797
- tomli
9898
- repo: https://github.com/PyCQA/bandit
99-
rev: 1.7.6
99+
rev: 1.7.7
100100
hooks:
101101
- id: bandit
102102
language_version: python3

hasmail/models/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Hasmail models."""
2+
23
# flake8: noqa
34

45
from __future__ import annotations

hasmail/views/email.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,11 @@ def recipient_view(mailer: Mailer, recipient: MailerRecipient) -> ResponseReturn
130130
{
131131
'template': ob.template,
132132
'preview': recipient.get_preview(),
133-
'subject': recipient.subject
134-
if recipient.subject is not None
135-
else draft.subject,
133+
'subject': (
134+
recipient.subject
135+
if recipient.subject is not None
136+
else draft.subject
137+
),
136138
'revision_id': ob.revision_id,
137139
}
138140
)

hasmail/views/mailer.py

+7-5
Original file line numberDiff line numberDiff line change
@@ -218,12 +218,14 @@ def mailer_send_do(mailer_id: int, user_uuid: UUID, email: str) -> None:
218218
# 3. Send message
219219
msg = Message(
220220
subject=(
221-
recipient.subject
222-
if recipient.subject is not None
221+
(
222+
recipient.subject
223+
if recipient.subject is not None
224+
else draft.subject
225+
)
226+
if recipient.custom_draft
223227
else draft.subject
224-
)
225-
if recipient.custom_draft
226-
else draft.subject,
228+
),
227229
sender=formataddr((user.fullname, email)),
228230
recipients=[formataddr((recipient.fullname or '', recipient.email))],
229231
body=recipient.rendered_text,

migrations/versions/124505044ba4_count_opens.py

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
77
"""
88

9-
109
import sqlalchemy as sa
1110
from alembic import op
1211

0 commit comments

Comments
 (0)