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):
self.save()
def update_printer_information(self):
for paper_tray in self.paper_trays.all():
paper_tray.update_from_snmp()
for supply in self.supplies.all():
supply.update_from_snmp()
self.refresh_alerts() # Since the number of alert is changing we refresh instead of update
self.update_from_snmp()
try:
for paper_tray in self.paper_trays.all():
paper_tray.update_from_snmp()
for supply in self.supplies.all():
supply.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):
for paper_tray in self.paper_trays.all():
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