|
@@ -236,10 +236,7 @@ class IPResourceAdmin(admin.ModelAdmin):
|
|
|
available_display.boolean = True
|
|
|
|
|
|
def last_use(self, obj):
|
|
|
- if obj.allocations.exists():
|
|
|
- return obj.allocations.last().end
|
|
|
- else:
|
|
|
- return None
|
|
|
+ return obj.last_use
|
|
|
last_use.short_description = 'Dernière utilisation'
|
|
|
last_use.admin_order_field = 'last_use'
|
|
|
|