소스 검색

#16388: Fix migration bug

Jeremy Stretch 1 년 전
부모
커밋
e12edd7420
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      netbox/extras/migrations/0116_move_objectchange.py

+ 1 - 1
netbox/extras/migrations/0116_move_objectchange.py

@@ -17,7 +17,7 @@ def update_dashboard_widgets(apps, schema_editor):
 
     for dashboard in Dashboard.objects.all():
         for key, widget in dashboard.config.items():
-            if getattr(widget['config'], 'model') == 'extras.objectchange':
+            if widget['config'].get('model') == 'extras.objectchange':
                 widget['config']['model'] = 'core.objectchange'
             elif models := widget['config'].get('models'):
                 models = list(map(lambda x: x.replace('extras.objectchange', 'core.objectchange'), models))