safwanrahman / django-webpush

Web Push Notification Package for Django
GNU General Public License v3.0
371 stars 107 forks source link

Fix to creating new subscription #130

Closed jialutu closed 1 year ago

jialutu commented 1 year ago

Currently, there is an issue creating new subscription if the user_agent is not specified in the post data. The issue is that the model does not state user_agent is nullable.

To prevent creating another migration file, I've defaulted the user_agent value to blank and added in the model file to allow user_agent to be blank.

safwanrahman commented 1 year ago

LGTM. r+

chrkr commented 6 months ago

This merge causes the library to be out of sync with its migration files. This means that if you add this library to a project and run makemigrations it creates a 0006 migration file in the library's install path, which is of course highly undesirable for a lot of reasons, and does not work at all in some cases.

To fix it, the changes to the model should also be applied to the 0003 migration file, to bring it back into sync. The changes are SQL no-ops anyway, so it will not affect existing operational databases.