mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-22 20:12:00 -06:00
#11685: Fix migration
This commit is contained in:
parent
5a4d8a7107
commit
972ba7bfdc
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user