Describe the bug
Upgrading from OpenWISP Notifications 1.1.0 to 1.2.0 resets user notification preferences to None in the database.
Steps To Replicate
- Checkout 1.1.0 version of openwisp-notifications and install all the dependencies. Start a celery worker and run the django server.
- Create a superuser.
- Open the superuser's change page and disable all the notifications.
- Stop the django server and the celery worker. Checkout the 1.2.0 version of openwisp-notifications. Install all dependencies and start django server and celery worker.
- Open the notification preferences page for the user.
Expected behavior
The notification preferences should stay as is after an upgrade.
Actual Result
The notification preferences get reset to None in the database after the upgrade.
Additional notes
Here's the SQL output from the database on version 1.1.0 after disabling all notifications from django admin:
SELECT id,type,web,email FROM openwisp_notifications_notificationsetting;
e8c790481c5d43639a66dcd760f9fab0 | default | 0 | 0
3e1f93f637fa40a48a40f23578bccbb2 | generic_message| 0 | 0
Here's the SQL output from the database after upgrading to version 1.2.0:
SELECT id,type,web,email FROM openwisp_notifications_notificationsetting;
e8c790481c5d43639a66dcd760f9fab0 |default | |
3e1f93f637fa40a48a40f23578bccbb2 |generic_message| |
05de43baa3d04fadbd17aafde329b330 | | 1 | 1
As you can see the user configured value for the NotificationSetting has been erased.
Describe the bug
Upgrading from OpenWISP Notifications 1.1.0 to 1.2.0 resets user notification preferences to
Nonein the database.Steps To Replicate
Expected behavior
The notification preferences should stay as is after an upgrade.
Actual Result
The notification preferences get reset to
Nonein the database after the upgrade.Additional notes
Here's the SQL output from the database on version 1.1.0 after disabling all notifications from django admin:
Here's the SQL output from the database after upgrading to version 1.2.0:
As you can see the user configured value for the NotificationSetting has been erased.