Commit 0acc91dd authored by Charlie Jacomme's avatar Charlie Jacomme

update_printer: stop yelling you son of a cron

parent c0568af2
...@@ -24,13 +24,15 @@ class Printer(models.Model): ...@@ -24,13 +24,15 @@ class Printer(models.Model):
self.save() self.save()
def update_printer_information(self): def update_printer_information(self):
for paper_tray in self.paper_trays.all(): try:
paper_tray.update_from_snmp() for paper_tray in self.paper_trays.all():
for supply in self.supplies.all(): paper_tray.update_from_snmp()
supply.update_from_snmp() for supply in self.supplies.all():
self.refresh_alerts() # Since the number of alert is changing we refresh instead of update supply.update_from_snmp()
self.update_from_snmp() self.refresh_alerts() # Since the number of alert is changing we refresh instead of update
self.update_from_snmp()
except SNMPException(err):
print err
def refresh_paper_trays(self): def refresh_paper_trays(self):
for paper_tray in self.paper_trays.all(): for paper_tray in self.paper_trays.all():
paper_tray.delete() paper_tray.delete()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment