Skip to content

[bug] User receives multiple identical notifications #277

@kkreitmair

Description

@kkreitmair

If a user is in several organizations,
they will receive multiple identical notifications.

The reason for this is that the database query, which determines which user should receive the notification, can return a user multiple times.

Steps to replicate the issue:

  1. Do a fresh installation of openwisp-controller as described in the docs and launch the development server.
  2. Re-enable the "default" notification type by commenting out the lines 268 to 272 in openwisp_controller/config/apps.py.
  3. Log In to the admin site with the user created during installation.
  4. Create a second organization.
  5. Make the user organization user of the two organizations (is_admin is not required).
  6. Create a nottification type setting for the type "Default Type" with organization default, web notification checked and email notification checked.
  7. Then create a notification with the following command: env/bin/python tests/manage.py create_notification
  8. This user will then receive the notification twice.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions