dropbox / securitybot

Distributed alerting for the masses!
Apache License 2.0
994 stars 112 forks source link

Crashed main.py by 'ignore' sent for non-existent user alerts #14

Open Iron-Bound opened 7 years ago

Iron-Bound commented 7 years ago

Hi, Have been able to crash the bot via "ignore last 1h1m" when no alert assigned for myself (user).

Traceback (most recent call last):
  File "main.py", line 45, in <module>
    main()
  File "main.py", line 42, in main
    sb.run()
  File "/home/ec2-user/securitybot/securitybot/bot.py", line 180, in run
    self.handle_messages()
  File "/home/ec2-user/securitybot/securitybot/bot.py", line 199, in handle_messages
    self.handle_command(user, text)
  File "/home/ec2-user/securitybot/securitybot/bot.py", line 211, in handle_command
    if cmd['fn'](self, user, args):
  File "/home/ec2-user/securitybot/securitybot/commands.py", line 69, in ignore
    if which == 'last' and user.old_tasks:
AttributeError: 'User' object has no attribute 'old_tasks'
ishanjain28 commented 7 years ago

Please Check PR #20 for a fix of this issue.