-
Notifications
You must be signed in to change notification settings - Fork 355
[ENG-10080] Create global_file_updated, global_reviews and node_files_updated subscriptions if missing #11556
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
base: feature/notifications-refactor-post-release
Are you sure you want to change the base?
Conversation
* Use USER_FILE_UPDATED for group global_file_updated * Use REVIEWS_SUBMISSION_STATUS for group global_reviews
Ostap-Zherebetskyi
left a comment
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.
LGTM 🎆
api/subscriptions/views.py
Outdated
| existing_subscriptions = annotated_obj_qs.filter(legacy_id=subscription_id) | ||
| except ObjectDoesNotExist: | ||
| raise NotFound | ||
| # `global_file_updated` and `global_reviews` should exist by default for every 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.
Just realized ObjectDoesNotExist won't be throw here, need to move the creation part out of the try/except.
| ), | ||
| ) | ||
| existing_subscriptions = annotated_obj_qs.filter(legacy_id=subscription_id) | ||
| if not existing_subscriptions: |
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.
| if not existing_subscriptions: | |
| if not existing_subscriptions.exists(): |
Ticket
Purpose
Create global_file_updated, global_reviews and node_files_updated subscriptions if missing
USER_FILE_UPDATEDfor group_global_file_updatedREVIEWS_SUBMISSION_STATUSfor group_global_reviewsNODE_FILE_UPDATEDfor group_node_files_updatedIn addition, added
_is_digest=Truefor newly created OSF users's default subscriptionsChanges
See dfif
Side Effects
N/A
QE Notes
N/A
CE Notes
N/A
Documentation
N/A