|
@@ -141,6 +141,11 @@ class Loan(models.Model):
|
|
|
def user_can_close(self, user):
|
|
|
return (not self.item.is_available()) and (self.user == user)
|
|
|
|
|
|
+ def is_running(self):
|
|
|
+ return not self.loan_date_end or self.loan_date_end > timezone.now()
|
|
|
+ is_running.boolean = True
|
|
|
+ is_running.short_description = 'En cours ?'
|
|
|
+
|
|
|
class Meta:
|
|
|
verbose_name = 'prêt d’objet'
|
|
|
verbose_name_plural = 'prêts d’objets'
|