webhooks: Directly invoke printer.invoke_shutdown()

No need to indirectly shutdown via the gcode class - just call
printer.invoke_shutdown() directly.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2020-08-04 16:03:20 -04:00
parent 4346d37c06
commit 795bd03b33
1 changed files with 1 additions and 2 deletions

View File

@ -255,8 +255,7 @@ class WebHooks:
def _handle_estop_request(self, web_request): def _handle_estop_request(self, web_request):
if web_request.get_method() != 'POST': if web_request.get_method() != 'POST':
raise web_request.error("Invalid Request Method") raise web_request.error("Invalid Request Method")
gcode = self.printer.lookup_object('gcode') self.printer.invoke_shutdown("Shutdown due to webhooks request")
gcode.cmd_M112(None)
def get_connection(self): def get_connection(self):
return self.sconn return self.sconn