-
Notifications
You must be signed in to change notification settings - Fork 345
[ENG-8064] Add New Notifications Data Model #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 #11151
Conversation
ecc8e88
to
3a8b414
Compare
3a8b414
to
57b0bd1
Compare
…cience/osf.io into add-new-notifications-data-model * 'feature/pbs-25-10' of https://github.com/CenterForOpenScience/osf.io: [ENG-7965] Add v2 email token confirmation endpoints (CenterForOpenScience#11139)
…cience/osf.io into add-new-notifications-data-model * 'feature/pbs-25-10' of https://github.com/CenterForOpenScience/osf.io: fix issue where not having any external identities caused a 500
…cience/osf.io into add-new-notifications-data-model * 'feature/pbs-25-10' of https://github.com/CenterForOpenScience/osf.io: [ENG-7966] Add "collected-in" relationship for Nodes (CenterForOpenScience#11140)
…cience/osf.io into add-new-notifications-data-model * 'feature/pbs-25-10' of https://github.com/CenterForOpenScience/osf.io: fix issue where trying another already confirmed email threw an uncaught exception (CenterForOpenScience#11161) [ENG-8148] Add ArtifactOutcome in annotations to linked nodes (CenterForOpenScience#11158)
…OpenScience/osf.io into add-new-notifications-data-model * 'refactor-notifications' of https://github.com/CenterForOpenScience/osf.io: flake8 fixed tests remove quickfiles update mails mock Update send_mail mocks Clean up tests Clean up tests Clean up imports Remove Meetings, Comments and OSF Groups Notifications remove osf groups remove osf groups remove osf groups remove osf groups remove osf groups # Conflicts: # tests/test_notifications.py
…cience/osf.io into add-new-notifications-data-model * 'feature/pbs-25-10' of https://github.com/CenterForOpenScience/osf.io: Update hybrid values for new workflow check (CenterForOpenScience#11166)
…OpenScience/osf.io into add-new-notifications-data-model * 'refactor-notifications' of https://github.com/CenterForOpenScience/osf.io: ignore Django maintenance state outside block
2b8ba0d
to
c449599
Compare
…OpenScience/osf.io into add-new-notifications-data-model * 'refactor-notifications' of https://github.com/CenterForOpenScience/osf.io: fixed bug with contributors remove superfluildous `groups` from serializer fix new and noteworth nodes bug going to Sentry
…cience/osf.io into add-new-notifications-data-model * 'feature/pbs-25-10' of https://github.com/CenterForOpenScience/osf.io: fixed None issue when iterate (CenterForOpenScience#11192) [ENG-8048] Remove caching to avoid incorrect results for ascendants (CenterForOpenScience#11169) [ENG-7870] Crossref DOIs not minting with _v1, OSF is displaying DOI versions with _v1 (CenterForOpenScience#11154) Update changelog and package.json [ENG-8145] [ENG-8147] Manual DOI and GUID for Preprints & Registrations - BE (CenterForOpenScience#11174)
…cience/osf.io into add-new-notifications-data-model * 'feature/pbs-25-10' of https://github.com/CenterForOpenScience/osf.io: Revert "[ENG-8048] Remove caching to avoid incorrect results for ascendants (…" Revert "fixed None issue when iterate (CenterForOpenScience#11192)"
…OpenScience/osf.io into add-new-notifications-data-model * 'refactor-notifications' of https://github.com/CenterForOpenScience/osf.io:
dfe88a2
to
ad18e9d
Compare
ad18e9d
to
300524c
Compare
into add-new-notifications-data-model * 'develop' of https://github.com/CenterForOpenScience/osf.io: Bump version no. Add CHANGELOG move CROSSREF_UNAVAILABLE_DELAY to settings.py handle and 5xx status code from crossref handle 500 error from crossref Update changelog and package.json
51d2685
to
86a9466
Compare
8495ecd
to
0139a5f
Compare
012a455
to
b4899ee
Compare
file_signals.file_updated.send(target=node, user=user, event_type=action, payload=payload) | ||
file_signals.file_updated.send(target=node, user=user, event_type=action, payload=payload) | ||
|
||
match f'node_{action}': |
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.
Improve this line, I think we can map actions better.
api/nodes/serializers.py
Outdated
@@ -1256,11 +1256,15 @@ def create(self, validated_data): | |||
|
|||
try: | |||
contributor_dict = { | |||
'auth': auth, 'user_id': id, 'email': email, 'full_name': full_name, 'send_email': send_email, | |||
'bibliographic': bibliographic, 'index': index, 'save': True, | |||
'auth': auth, |
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.
revert this
api/nodes/views.py
Outdated
user=user, | ||
event_context={ | ||
'guid': node._id, | ||
'title': node._id, |
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.
redo
api/nodes/views.py
Outdated
user=user, | ||
event_context={ | ||
'guid': fork._id, | ||
'title': node._id, |
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.
redo
api/providers/serializers.py
Outdated
|
||
if bool(get_perms(user, provider)): | ||
raise ValidationError('Specified user is already a moderator.') | ||
if 'claim_url' in context: | ||
template = mails.CONFIRM_EMAIL_MODERATION(provider) | ||
template = NotificationType.Type.PROVIDER_CONFIRM_EMAIL_MODERATION |
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.
refactor template
api/providers/serializers.py
Outdated
user.username, | ||
template, | ||
**context, | ||
print(template, context) |
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.
remove
api/providers/tasks.py
Outdated
@@ -636,88 +639,78 @@ def bulk_upload_finish_job(upload, row_count, success_count, draft_errors, appro | |||
approval_errors.sort() | |||
if not dry_run: | |||
upload.save() | |||
notification_type = 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.
what?
api/providers/tasks.py
Outdated
upload.email_sent = timezone.now() | ||
upload.save() | ||
logger.info(f'Email sent to bulk upload initiator [{initiator._id}]') | ||
logger.info(f'Notification sent to bulk upload initiator [{initiator._id}]') |
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.
revert
b4899ee
to
7e96d6f
Compare
21ce32a
to
46b6944
Compare
message_frequency='instantly', | ||
event_context={ | ||
'sender': sender.username, | ||
'bcc_addr': [sender.username] if validated_data['bcc_sender'] else 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.
Consider improving bcc
and reply_to
support.
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.
Does mailhog test for this?
616d17b
to
b5bdebe
Compare
Purpose
This is Phase 2 of the Notifications Refactor it creates a new notification system and migrates the existing data into that model.
Changes
notifications.yaml
for data dependency notificationtypescapture_notifications
mocking utilQA 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