introduce extra var bc can't write to private attribute

This commit is contained in:
b3yond 2018-11-12 12:32:28 +01:00
parent f274d25822
commit 268b9748c3

View file

@ -46,12 +46,12 @@ class TelegramBot(Bot):
# TODO: /help message should be set in frontend
else:
# set report.author to "" to avoid mailbot crash
if update.message.sender.username is None:
update.message.sender.username = ""
sender_name = update.message.sender.username
if sender_name is None:
sender_name = ""
reports.append(Report(update.message.sender.username, self,
update.message.text, None,
update.message.date))
reports.append(Report(sender_name, self, update.message.text,
None, update.message.date))
return reports
def post(self, user, report):