Search code examples
pythondjangopinaxcode-reuse

Set django-notification to be opt in rather than the default of opt out


I'm using django-notification to allow my users to opt out of certain alerts I generate in my web-application.

By default when I create a new notice type it is enabled rather than disabled In the users notification interface (checked)

I'd like to make some alerts opt-in rather than the default of opt out. I've looked through the docs and been unable to see a way to do this, has anyone else managed to accomplish this?


Solution

  • Its automatically set based on the 'default' column in the type itself, by default e-mail is a sensitivity of 2, so if you set the default to your new notice type default '1' it will no longer set it on by default for your users, the default when creating new notice types is '2' which would allow it to be sent to everyone.