From 310d23006b0507774945d97e63c090dd2631a2e1 Mon Sep 17 00:00:00 2001 From: Ruben van de Ven Date: Sat, 2 Nov 2019 22:34:44 +0100 Subject: [PATCH] Clear status page on return --- sorteerhoed/central_management.py | 1 + sorteerhoed/webserver.py | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/sorteerhoed/central_management.py b/sorteerhoed/central_management.py index 9213dfa..14e30bc 100644 --- a/sorteerhoed/central_management.py +++ b/sorteerhoed/central_management.py @@ -355,6 +355,7 @@ class CentralManagement(): self.plotter.park() scan = threading.Thread(target=self.cleanDrawing, name='reset') scan.start() + self.server.statusPage.clearAssignment() def scanImage(self) -> str: """ diff --git a/sorteerhoed/webserver.py b/sorteerhoed/webserver.py index 4095b09..516954d 100644 --- a/sorteerhoed/webserver.py +++ b/sorteerhoed/webserver.py @@ -377,6 +377,16 @@ class StatusPage(): self.hit_created = None self.hit_opened = None self.hit_submitted = None + + def clearAssignment(self): + logger.info("Resetting hit assignment") + self.worker_id = None + self.ip = None + self.location = None + self.browser = None + self.os = None + self.resolution = None + self.hit_created = None def __setattr__(self, name, value): if name in self.__dict__ and self.__dict__[name] == value: