diff --git a/device/models.py b/device/models.py index aa0b95f..ce874fd 100644 --- a/device/models.py +++ b/device/models.py @@ -33,6 +33,7 @@ class Device: self.hids = [] self.uuids = [] self.evidences = [] + self.lots = [] self.last_evidence = None self.get_last_evidence() @@ -41,6 +42,7 @@ class Device: self.get_uuids() self.get_hids() self.get_evidences() + self.get_lots() def get_annotations(self): if self.annotations: @@ -107,6 +109,9 @@ class Device: def last_uuid(self): return self.uuids[0] + def get_lots(self): + self.lots = [x.lot for x in DeviceLot.objects.filter(device_id=self.id)] + @classmethod def get_unassigned(cls, user): chids = DeviceLot.objects.filter(lot__owner=user).values_list("device_id", flat=True).distinct() diff --git a/device/templates/details.html b/device/templates/details.html index 38e1d78..a549910 100644 --- a/device/templates/details.html +++ b/device/templates/details.html @@ -121,7 +121,7 @@ {% for tag in lot_tags %}