AlexVerrico / octoprint-stats

Stats for your octoprint instance. Mirrored from https://github.com/amsbr/OctoPrint-Stats originally
14 stars 8 forks source link

Resolve errors when "owner" or "user" are not defined in event playload #33

Closed antimatter15 closed 2 years ago

antimatter15 commented 2 years ago

This patch should fix https://github.com/AlexVerrico/octoprint-stats/issues/32 as well as the issues that I'm running into when using the Continuous Print plugin

Traceback (most recent call last):
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/plugin/__init__.py", line 273, in call_plugin
    result = getattr(plugin, method)(*args, **kwargs)
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint/util/__init__.py", line 1688, in wrapper
    return f(*args, **kwargs)
  File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_stats/__init__.py", line 834, in on_event
    owner = payload["owner"]
KeyError: 'owner'
AlexVerrico commented 2 years ago

Hi @antimatter15. Thanks for this, I'll merge it now. Cheers, Alex.