[email] Fix coding style

This commit is contained in:
maike 2020-07-11 04:36:12 +02:00 committed by dl6tom
parent 7f07e566eb
commit 0725523926
2 changed files with 6 additions and 2 deletions

View file

@ -47,4 +47,6 @@ async def main():
'author': mail.get_unixfrom(), 'author': mail.get_unixfrom(),
'secret': email_row.secret, 'secret': email_row.secret,
} }
requests.post('http://localhost:8000/api/hoods/%d/email/messages/' % (hood.id), data=body) requests.post(
'http://localhost:8000/api/hoods/%d/email/messages/' % (hood.id), data=body
)

View file

@ -158,7 +158,9 @@ async def email_message_create(
logger.warning(str(message)) logger.warning(str(message))
logger.warning(str(email_row)) logger.warning(str(email_row))
if message.secret != email_row.secret: if message.secret != email_row.secret:
logger.warning("Someone is trying to submit an email without the correct API secret") logger.warning(
"Someone is trying to submit an email without the correct API secret"
)
raise HTTPException(status_code=status.HTTP_401_UNAUTHORIZED) raise HTTPException(status_code=status.HTTP_401_UNAUTHORIZED)
# pass message.text to bot.py # pass message.text to bot.py
if await spawner.get(email_row).publish(Message(message.text)): if await spawner.get(email_row).publish(Message(message.text)):