Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
ensembl-web
ensembl_ticket_manager
Commits
1bb6403a
Commit
1bb6403a
authored
Aug 18, 2021
by
Kamal Dodiya
Browse files
Fix request without attachment
parent
0117fa00
Pipeline
#185752
failed with stages
in 1 minute and 27 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
app/api/resources/mail_manager/mail_manager.py
app/api/resources/mail_manager/mail_manager.py
+7
-6
No files found.
app/api/resources/mail_manager/mail_manager.py
View file @
1bb6403a
...
...
@@ -35,12 +35,13 @@ async def send_email_wtih_attachment_async(tq):
message
[
"Subject"
]
=
f
"
{
tq
[
'subject'
]
}
-
{
tq
[
'request'
].
headers
[
'Host'
]
}
"
body
=
await
format_message
(
tq
)
message
.
set_content
(
body
)
for
attachment
in
tq
[
"files"
]:
maintype
,
subtype
=
attachment
.
content_type
.
split
(
'/'
,
1
)
message
.
add_attachment
(
attachment
.
file
.
read
(),
maintype
=
maintype
,
subtype
=
subtype
,
filename
=
attachment
.
filename
)
if
tq
[
"files"
]
is
not
None
:
for
attachment
in
tq
[
"files"
]:
maintype
,
subtype
=
attachment
.
content_type
.
split
(
'/'
,
1
)
message
.
add_attachment
(
attachment
.
file
.
read
(),
maintype
=
maintype
,
subtype
=
subtype
,
filename
=
attachment
.
filename
)
await
aiosmtplib
.
send
(
message
,
hostname
=
Envs
.
MAIL_SERVER
,
port
=
Envs
.
MAIL_PORT
)
logger
.
info
(
f
"The email sent successfully for
{
tq
[
'email'
]
}
"
)
return
True
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment