mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-17 04:58:16 -06:00
14438 optimize migration
This commit is contained in:
parent
bc596340c3
commit
ee88c2f7d2
@ -17,13 +17,9 @@ def update_event_rules(apps, schema_editor):
|
||||
obj, created = Script.objects.get_or_create(
|
||||
module_id=rule.action_object_id,
|
||||
name=name,
|
||||
defaults={'is_valid': False}
|
||||
)
|
||||
|
||||
if created:
|
||||
# script in action_parameters was deleted?
|
||||
obj.is_valid = False
|
||||
obj.save()
|
||||
|
||||
rule.action_object_type = ct
|
||||
rule.action_object_id = obj.id
|
||||
rule.save()
|
||||
|
Loading…
Reference in New Issue
Block a user