Élie Bouttier 7 years ago
parent
commit
3c806ab108

+ 0 - 2
services/management/commands/checkvm.py

@@ -1,9 +1,7 @@
 from django.core.management.base import BaseCommand, CommandError
 from django.contrib.contenttypes.models import ContentType
-from django.utils import timezone
 
 import re, sys, os, json
-from datetime import datetime
 
 from adhesions.models import Adhesion
 from services.models import Service, ServiceType, IPResource, Route

+ 0 - 1
services/management/commands/fetchcmklabels.py

@@ -2,7 +2,6 @@ from django.core.management.base import BaseCommand
 
 import socket, csv
 from pytz import timezone
-from datetime import datetime
 from collections import namedtuple
 from itertools import groupby
 

+ 1 - 1
stocking/admin.py

@@ -89,7 +89,7 @@ class CategoryAdmin(StockMixin, MPTTModelAdmin):
 class LocationAdmin(StockMixin, admin.ModelAdmin):
     def has_delete_permission(self, request, obj=None):
         # Interdiction de supprimer l’emplacement si il contient des équipements
-        return obj and not obj.equipment_set.exists()
+        return obj and not obj.equipments.exists()
 
 
 #class EquipmentAdmin(admin.ModelAdmin):