|
@@ -128,6 +128,16 @@ class Loan(models.Model):
|
|
return 'prêt de {item} à {user}'.format(
|
|
return 'prêt de {item} à {user}'.format(
|
|
item=self.item, user=self.user)
|
|
item=self.item, user=self.user)
|
|
|
|
|
|
|
|
+ def get_mac_or_serial(self):
|
|
|
|
+ mac = self.item.mac_address
|
|
|
|
+ serial = self.item.serial
|
|
|
|
+ if mac and serial:
|
|
|
|
+ return "{} / {}".format(mac, serial)
|
|
|
|
+ else:
|
|
|
|
+ return mac or serial or ''
|
|
|
|
+
|
|
|
|
+ get_mac_or_serial.short_description = "Adresse MAC / n° de série"
|
|
|
|
+
|
|
def user_can_close(self, user):
|
|
def user_can_close(self, user):
|
|
return (not self.item.is_available()) and (self.user == user)
|
|
return (not self.item.is_available()) and (self.user == user)
|
|
|
|
|