Просмотр исходного кода

Correct mistake made on determination of whether it is a tag or not

Daniel Sheppard 6 месяцев назад
Родитель
Сommit
6c0dc8b630
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      netbox/core/signals.py

+ 1 - 1
netbox/core/signals.py

@@ -75,7 +75,7 @@ def handle_changed_object(sender, instance, **kwargs):
         event_type = OBJECT_UPDATED
     elif kwargs.get('action') == 'post_clear':
         # Handle clearing of an M2M field
-        if isinstance(Tag, kwargs.get('model')) and getattr(instance, '_prechange_snapshot', {}).get('tags'):
+        if kwargs.get('model') == Tag and getattr(instance, '_prechange_snapshot', {}).get('tags'):
             # Handle generation of M2M changes for Tags which have a previous value (ignoring changes where the
             # prechange snapshot is empty)
             m2m_changed = True