Verified Commit 88236a2d authored by Grégor JOUET's avatar Grégor JOUET 🔧
Browse files

Save state change after normal print

parent 380b3fb4
Loading
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -516,9 +516,9 @@ class OctoPrinter(PrinterBase):
            return
        if reason == RESET_CANCEL or reason == RESET_ERROR or reason == RESET_FAILURE:
            self.printer_obj.current_print.status = 11 # REQUEST_STATUS_PRINT_FAILED
            self.printer_obj.current_print.save()
        if reason == RESET_SUCCESS:
            self.printer_obj.current_print.status = 7 # REQUEST_STATUS_INSPECTING
        self.printer_obj.current_print.save()
        # TODO v3 : Printer statistics
        # save printer in request
        self.printer_obj.current_print = None
@@ -587,6 +587,7 @@ class OctoPrinter(PrinterBase):
                # We just finished a print, check the reason;
                # set the print status and remove current print
                if not self.cancel_flag:
                    self.log("Normal print end")
                    self.reset_current_print(RESET_ERROR if status["state"]["flags"]["error"] else RESET_SUCCESS)  
            return