Skip to content

Commit d8aa17e

Browse files
committed
[fix] Fixed 0060_cleanup_api_task_notification_types (missing dep)
This migration lacked an explicit dependency on the notifications module's migrations, which could cause it to run before the NotificationSetting model is available, resulting in a crash.
1 parent d5bc8a1 commit d8aa17e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

openwisp_controller/config/migrations/0060_cleanup_api_task_notification_types.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ def cleanup_api_task_notification_types(apps, schema_editor):
77
if not apps.is_installed("openwisp_notifications"):
88
return
99
Notification = apps.get_model("openwisp_notifications", "Notification")
10+
import ipdb
11+
12+
ipdb.set_trace()
1013
NotificationSetting = apps.get_model(
11-
"openwisp_notifications", "NotificationSetting"
14+
"openwisp_notifications", "NotificationSetting", require_ready=True
1215
)
1316
NotificationSetting.objects.filter(
1417
type__in=["api_task_error", "api_task_recovery"]
@@ -22,6 +25,10 @@ class Migration(migrations.Migration):
2225

2326
dependencies = [
2427
("config", "0059_zerotier_templates_ow_zt_to_global"),
28+
(
29+
"openwisp_notifications",
30+
"0009_alter_notificationsetting_organization_and_more",
31+
),
2532
]
2633

2734
operations = [

0 commit comments

Comments
 (0)