Clear status page on return

This commit is contained in:
Ruben van de Ven 2019-11-02 22:34:44 +01:00
parent ecafb1db80
commit 310d23006b
2 changed files with 11 additions and 0 deletions

View file

@ -355,6 +355,7 @@ class CentralManagement():
self.plotter.park() self.plotter.park()
scan = threading.Thread(target=self.cleanDrawing, name='reset') scan = threading.Thread(target=self.cleanDrawing, name='reset')
scan.start() scan.start()
self.server.statusPage.clearAssignment()
def scanImage(self) -> str: def scanImage(self) -> str:
""" """

View file

@ -378,6 +378,16 @@ class StatusPage():
self.hit_opened = None self.hit_opened = None
self.hit_submitted = 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): def __setattr__(self, name, value):
if name in self.__dict__ and self.__dict__[name] == value: if name in self.__dict__ and self.__dict__[name] == value:
logger.debug(f"Ignore setting status of {name}: it already is set to {value}") logger.debug(f"Ignore setting status of {name}: it already is set to {value}")