-
Notifications
You must be signed in to change notification settings - Fork 350
[ENG-9664] Fix node subscriptions API filtering #11405
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
[ENG-9664] Fix node subscriptions API filtering #11405
Conversation
| assert put_res.status_code == 405 | ||
| assert delete_res.status_code == 405 | ||
|
|
||
| def test_multiple_values_filter(self, app, url, file_updated_notification, user): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we were adding the wrong type of notification before.
| object_id=user.id, | ||
| content_type=ContentType.objects.get_for_model(user), | ||
| _is_digest=True, | ||
| message_frequency='instantly', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing message_frequency not strictly related to filtering issue, but necessary as NoneType values aren't recognized as default by FE.
| NotificationSubscription( | ||
| user=contributor, | ||
| notification_type=NotificationType.Type.FILE_UPDATED.instance, | ||
| notification_type=NotificationType.Type.NODE_FILE_UPDATED.instance, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ultimately this was what was cause the issues, FILE_UPDATED is the item with the NODE_FILE_UPDATED digest.
| assert subs.filter(object_id=obj.id, content_type=content_type).exists() | ||
|
|
||
| def test_migrate_node_subscription(self, users, user, node): | ||
| self.create_legacy_sub('file_updated', users, user=user, node=node) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is now not needed because subscription is now being correctly sent by the signal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, one minor issue
7b09dc4
into
CenterForOpenScience:feature/notification-refactor-p2-s
|
LGTM! |
Purpose
Fix issue where node preferences don't appear on the node settings page.
Changes
QA Notes
Needs minor FE change: CenterForOpenScience/angular-osf#734
What are the areas of risk?
Any concerns/considerations/questions that development raised?
Documentation
Side Effects
Ticket
https://openscience.atlassian.net/browse/ENG-9664