fix mailbot crash:
File "/srv/ticketfrei/active_bots/mailbot.py", line 37, in post if rec not in report.author: TypeError: argument of type 'NoneType' is not iterable
This commit is contained in:
parent
8b36589557
commit
710a89c282
|
@ -45,6 +45,10 @@ class TelegramBot(Bot):
|
||||||
"Send reports here to share them with other users. Use /start and /stop to get reports or not.")
|
"Send reports here to share them with other users. Use /start and /stop to get reports or not.")
|
||||||
# TODO: /help message should be set in frontend
|
# TODO: /help message should be set in frontend
|
||||||
else:
|
else:
|
||||||
|
# set report.author to "" to avoid mailbot crash
|
||||||
|
if update.message.sender.username is None:
|
||||||
|
update.message.sender.username = ""
|
||||||
|
|
||||||
reports.append(Report(update.message.sender.username, self,
|
reports.append(Report(update.message.sender.username, self,
|
||||||
update.message.text, None,
|
update.message.text, None,
|
||||||
update.message.date))
|
update.message.date))
|
||||||
|
|
Loading…
Reference in a new issue