-
Notifications
You must be signed in to change notification settings - Fork 348
[ENG-8064] Add New Notifications Data Model (Refactor Notifications Phase 2) #11151
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: refactor-notifications
Are you sure you want to change the base?
[ENG-8064] Add New Notifications Data Model (Refactor Notifications Phase 2) #11151
Conversation
3a8b414
to
57b0bd1
Compare
2b8ba0d
to
c449599
Compare
ad18e9d
to
300524c
Compare
2dee1b2
to
2dbcbf7
Compare
9238258
to
37b419a
Compare
afc3815
to
b6bbeed
Compare
12a9842
to
4c69f7e
Compare
Allow the User Preprints endpoint (/v2/users/me/preprints) to be filterable by title (?filter[title]=example), similar to how the User Nodes endpoint (/v2/users/me/nodes) supports this filter capability
…terForOpenScience#11210) Enable Product Team to Force Archive Registrations in the Admin App
bb4f441
to
106679b
Compare
106679b
to
d43de2b
Compare
4c3adc7
to
e7266b9
Compare
@@ -830,7 +860,7 @@ def addon_deleted_file(auth, target, error_type='BLAME_PROVIDER', **kwargs): | |||
'version_id': None, | |||
'file_guid': file_guid, | |||
'file_id': file_node._id, | |||
'provider': file_node.provider, | |||
'preprint_word': getattr(file_node.target.provider, 'preprint_word', None), |
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.
@Johnetordoff check
@@ -190,7 +183,19 @@ async def test_submit_success(self): | |||
assert self.mock_job.refresh.call_count == 4 | |||
assert mock_async_sleep.call_count == 4 | |||
mock_close.assert_called() | |||
self.mock_send_grid.assert_called() | |||
mock_send_mail.assert_called_with( |
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.
Added these back in based on previous CR
b241b26
to
05aad5e
Compare
return {'status': 'success'} | ||
|
||
|
||
@file_signals.file_updated.connect | ||
def addon_delete_file_node(self, target, user, event_type, payload): |
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.
Notice event_type
is gone as that was always derived from the payload anyway, cleans up the logic a lot.
@@ -69,16 +69,6 @@ def form_valid(self, form): | |||
|
|||
# create AdminProfile for this new user | |||
profile, created = AdminProfile.objects.get_or_create(user=osf_user) | |||
|
|||
for group in form.cleaned_data.get('group_perms'): |
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.
@Johnetordoff Should get done on demand now
|
||
class FrequencyField(ser.ChoiceField): | ||
def __init__(self, **kwargs): | ||
super().__init__(choices=['none', 'instantly', 'daily', 'weekly', 'monthly'], **kwargs) |
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.
@Johnetordoff keep for now
…/centerforopenscience/osf.io into add-new-notifications-data-model * 'add-new-notifications-data-model' of https://github.com/centerforopenscience/osf.io: revert some syntax changes to shrink diff revert ResourceContributorsCreateSerializer refactor update tests
920ac12
to
d3c238c
Compare
d3c238c
to
8937680
Compare
…/centerforopenscience/osf.io into add-new-notifications-data-model * 'add-new-notifications-data-model' of https://github.com/centerforopenscience/osf.io: update moderation notification tests
1a4976f
to
de56134
Compare
…/centerforopenscience/osf.io into add-new-notifications-data-model * 'add-new-notifications-data-model' of https://github.com/centerforopenscience/osf.io: update subjects and mailhog tests
22e81be
to
6816040
Compare
3ca708c
to
5d0b6b4
Compare
5d0b6b4
to
b8fdc80
Compare
…/centerforopenscience/osf.io into add-new-notifications-data-model * 'add-new-notifications-data-model' of https://github.com/centerforopenscience/osf.io: fix more test stuff # Conflicts: # osf/models/schema_response.py
Purpose
This system is designed to formalize and consolidate OSF Notifications under one system in order to better facilitate collaboration between Product, Engineers and QA and end persistent problems with notification email related tech debt. This project is the result of an extensive audit of all OSF emails and combined email digests and seeks to move the
NotificationSubscription
model out of it's transitional state having been migrated from a document based model, into it's final data model which is more regular for a relation our current relational database (django's postgress db).In order to do this I have taken @mfraezz design documents and implemented them with minor changes. This means the responsibility for sending notifications in osf.io is shared by three new models, which will have the old data migrated into them via a migration script and management command. The models are:
NotificationType
notification.yaml
a developer will be able to see at a glance if where a notification template is and what it's purpose is.NotificationSubscription
EmailDigest
model, this holds references to potentially many Notifcations models that can be compiled into a single digest this is sent at a periodic basis.Notification
Changes
notifications.yaml
to contain all notification types info it is populated via postmigrate hookNotification
NotificationSubscription
andNotificationType
send_mails
method and replaces it withemit
ofNotificationType
handle_boa_error
to pass the already decanted user object.notifications.yaml
for data dependency notificationtypescapture_notifications
mocking utilqueued_mail
EmailDigest
detect_duplicates
for duplicate subscriptionsQA Notes
Please make verification statements inspired by your code and what your code touches.
What are the areas of risk?
Any concerns/considerations/questions that development raised?
Documentation
Side Effects
Ticket
https://openscience.atlassian.net/browse/ENG-8064