Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] Improve UX of the Notifications Module #344

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

pandafy
Copy link
Member

@pandafy pandafy commented Mar 24, 2025

Closes #132
Closes #306
Closes #110
Closes #148
Closes #255

Dhanus3133 and others added 4 commits March 24, 2025 16:47
Implements and closes #132.

---------

Co-authored-by: Federico Capoano <f.capoano@openwisp.io>
Co-authored-by: Gagan Deep <pandafy.dev@gmail.com>
Closes: #306

Co-authored-by: Federico Capoano <f.capoano@openwisp.io>
Closes #110
Closes #148
Closes #255

---------

Co-authored-by: Federico Capoano <f.capoano@openwisp.io>
Co-authored-by: Gagan Deep <pandafy.dev@gmail.com>
Dhanus3133 and others added 3 commits March 24, 2025 17:36
Implements and closes #256

---------

Co-authored-by: Federico Capoano <f.capoano@openwisp.io>
Co-authored-by: Gagan Deep <pandafy.dev@gmail.com>
@pandafy pandafy requested a review from Dhanus3133 March 24, 2025 12:35
@pandafy
Copy link
Member Author

pandafy commented Mar 24, 2025

@Dhanus3133 can you ensure that the coverage does not decrease for these files:

  • api/serializers.py
  • base/models.py
  • tasks.py

@Dhanus3133
Copy link
Member

@pandafy For the coverage missing on base/models.py

def email_notification(self):
if self.email is not None:
return self.email

Seems to be due to the defaults being set here

def create_notification_settings(user, organizations, notification_types):
global_setting, _ = NotificationSetting.objects.get_or_create(
user=user, organization=None, type=None, defaults={'email': True, 'web': True}
)
for type in notification_types:
notification_config = types.get_notification_configuration(type)
for org in organizations:
NotificationSetting.objects.update_or_create(
defaults={
'deleted': False,
'email': global_setting.email
and notification_config.get('email_notification'),
'web': global_setting.web
and notification_config.get('web_notification'),
},
user=user,
type=type,
organization=org,
)

But if that's the case

def web_notification(self):
if self.web is not None:
return self.web
this should also cause a coverage issue but it doesn't, not sure why.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Needs review
2 participants