introduce extra var bc can't write to private attribute

master
b3yond 2018-11-12 12:32:28 +01:00
parent 25b9108e7f
commit 5e5429dcfe
1 changed files with 5 additions and 5 deletions

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):