jeremystretch %!s(int64=3) %!d(string=hai) anos
pai
achega
972ba7bfdc
Modificáronse 1 ficheiros con 5 adicións e 2 borrados
  1. 5 2
      netbox/ipam/migrations/0064_clear_search_cache.py

+ 5 - 2
netbox/ipam/migrations/0064_clear_search_cache.py

@@ -10,8 +10,11 @@ def clear_cache(apps, schema_editor):
     CachedValue = apps.get_model('extras', 'CachedValue')
 
     for model_name in ('Aggregate', 'IPAddress', 'IPRange', 'Prefix'):
-        content_type = ContentType.objects.get(app_label='ipam', model=model_name.lower())
-        CachedValue.objects.filter(object_type=content_type).delete()
+        try:
+            content_type = ContentType.objects.get(app_label='ipam', model=model_name.lower())
+            CachedValue.objects.filter(object_type=content_type).delete()
+        except ContentType.DoesNotExist:
+            pass
 
 
 class Migration(migrations.Migration):