Skip to content

Commit dc23226

Browse files
committed
sync naming
1 parent e3b8afa commit dc23226

4 files changed

Lines changed: 15 additions & 123 deletions

File tree

framework/auth/campaigns.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
CAMPAIGNS = None
1515
CAMPAIGNS_LAST_REFRESHED = timezone.now()
1616

17-
17+
# TODO: should clean campaigns
1818
def get_campaigns():
1919

2020
global CAMPAIGNS

notifications.yaml

Lines changed: 9 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -46,27 +46,6 @@ notification_types:
4646
tests: ['osf_tests/test_user.py', 'tests/test_auth.py']
4747
template: 'website/templates/password_reset.html.mako'
4848

49-
- name: user_contributor_added_preprint_node_from_osf
50-
subject: 'You have been added as a contributor to an OSF preprint'
51-
__docs__: ...
52-
object_content_type_model_name: osfuser
53-
template: 'website/templates/contributor_added_preprint_node_from_osf.html.mako'
54-
tests: []
55-
56-
- name: user_contributor_added_access_request
57-
subject: 'You have been added as a contributor to an OSF project'
58-
__docs__: ...
59-
object_content_type_model_name: osfuser
60-
tests: ['tests/test_claim_views.py', 'api_tests/requests/views/test_request_actions_create.py', 'api_tests/requests/mixins.py', 'osf_tests/test_institutional_admin_contributors.py']
61-
template: 'website/templates/contributor_added_access_request.html.mako'
62-
63-
- name: user_contributor_added_osf_preprint
64-
subject: 'You have been added as a contributor to an OSF preprint.'
65-
__docs__: ...
66-
object_content_type_model_name: osfuser
67-
tests: []
68-
template: 'website/templates/contributor_added_preprint_node_from_osf.html.mako'
69-
7049
- name: user_external_login_link_success
7150
subject: 'OSF Verification Success'
7251
__docs__: ...
@@ -81,13 +60,6 @@ notification_types:
8160
tests: ['tests/test_auth_views.py']
8261
template: 'website/templates/confirm.html.mako'
8362

84-
- name: forgot_password
85-
subject: 'Reset Password'
86-
__docs__: ...
87-
object_content_type_model_name: osfuser
88-
tests: ['api_tests/users/views/test_user_settings_reset_password.py', 'tests/test_forgot_password.py']
89-
template: 'website/templates/forgot_password.html.mako'
90-
9163
- name: user_welcome
9264
subject: 'Welcome to OSF'
9365
__docs__: ...
@@ -137,13 +109,6 @@ notification_types:
137109
tests: ['tests/test_adding_contributor_views.py', 'api_tests/users/views/test_user_claim.py', 'tests/test_claim_views.py']
138110
template: 'website/templates/invite_default.html.mako'
139111

140-
- name: user_pending_invite
141-
subject: 'You have been invited to contribute to an OSF project'
142-
__docs__: ...
143-
object_content_type_model_name: osfuser
144-
tests: []
145-
template: 'website/templates/pending_invite.html.mako'
146-
147112
- name: user_forward_invite_registered
148113
subject: 'Please forward to {user_fullname}'
149114
__docs__: ...
@@ -165,13 +130,6 @@ notification_types:
165130
template: 'website/templates/initial_confirm.html.mako'
166131
tests: ['tests/test_resend_confirmation.py', 'tests/test_auth.py']
167132

168-
- name: user_export_data_request
169-
subject: 'Data Export Request'
170-
__docs__: ...
171-
object_content_type_model_name: osfuser
172-
template: 'website/templates/support_request.html.mako'
173-
tests: []
174-
175133
- name: user_request_deactivation
176134
subject: '[via OSF] Deactivation Request'
177135
__docs__: ...
@@ -193,13 +151,6 @@ notification_types:
193151
template: 'website/templates/storage_cap_exceeded_announcement.html.mako'
194152
tests: []
195153

196-
- name: user_duplicate_accounts_sso_osf4i
197-
subject: 'Duplicate Account Detection'
198-
__docs__: ...
199-
object_content_type_model_name: osfuser
200-
template: 'website/templates/duplicate_accounts_sso_osf4i.html.mako'
201-
tests: []
202-
203154
- name: user_duplicate_accounts_osf4i
204155
subject: 'Duplicate Account Detection'
205156
__docs__: ...
@@ -242,14 +193,14 @@ notification_types:
242193
template: 'website/templates/registration_bulk_upload_success_partial.html.mako'
243194
tests: ['api_tests/providers/tasks/test_bulk_upload.py']
244195

245-
- name: user_registration_bulk_upload_failure_duplicates
196+
- name: registration_bulk_upload_failure_duplicates
246197
subject: 'Bulk Registration Upload Failed - Duplicates Found'
247198
__docs__: ...
248199
object_content_type_model_name: osfuser
249200
template: 'website/templates/registration_bulk_upload_failure_duplicates.html.mako'
250201
tests: []
251202

252-
- name: registration_bulk_upload_unexpected_failure
203+
- name: desk_user_registration_bulk_upload_unexpected_failure
253204
subject: 'Bulk Registration Upload Unexpected Failed'
254205
__docs__: ...
255206
object_content_type_model_name: osfuser
@@ -319,30 +270,24 @@ notification_types:
319270
template: 'website/templates/archive_uncaught_error_user.html.mako'
320271
tests: []
321272

322-
- name: user_confirm_email_erpc
273+
- name: user_campaign_confirm_email_erpc
323274
subject: 'OSF Account Verification, Election Research Preacceptance Competition'
324275
object_content_type_model_name: osfuser
325276
template: 'website/templates/confirm_erpc.html.mako'
326277
tests: []
327278

328-
- name: user_confirm_email_agu_conference
279+
- name: user_campaign_confirm_email_agu_conference
329280
subject: 'OSF Account Verification, from the American Geophysical Union Conference'
330281
object_content_type_model_name: osfuser
331282
template: 'website/templates/confirm_erpc.html.mako'
332283
tests: []
333284

334-
- name: user_confirm_email_registries_osf
285+
- name: user_campaign_confirm_email_registries_osf # TODO: recheck
335286
subject: 'OSF Account Verification, OSF Registries'
336287
object_content_type_model_name: osfuser
337288
template: 'website/templates/confirm_registries_osf.html.mako'
338289
tests: []
339290

340-
- name: user_confirm_email_preprints
341-
subject: 'OSF Account Verification, Preprints'
342-
object_content_type_model_name: osfuser
343-
template: 'website/templates/confirm_preprints_osf.html.mako'
344-
tests: ['']
345-
346291
- name: user_confirm_merge
347292
subject: 'Confirm account merge'
348293
object_content_type_model_name: osfuser
@@ -373,7 +318,7 @@ notification_types:
373318
template: 'website/templates/tou_notif.html.mako'
374319
tests: []
375320

376-
- name: user_registration_bulk_upload_product_owner
321+
- name: desk_registration_bulk_upload_product_owner
377322
subject: 'Registry Could Not Bulk Upload Registrations'
378323
object_content_type_model_name: osfuser
379324
template: 'website/templates/registration_bulk_upload_product_owner.html.mako'
@@ -412,13 +357,6 @@ notification_types:
412357
template: 'website/templates/new_pending_withdraw_requests.html.mako'
413358
tests: ['tests/test_registrations/test_review_flows.py']
414359

415-
- name: provider_contributor_added_preprint
416-
subject: 'Contributor Added to Preprint'
417-
__docs__: ...
418-
object_content_type_model_name: abstractprovider
419-
template: 'website/templates/contributor_added_preprints.html.mako'
420-
tests: []
421-
422360
- name: provider_confirm_email_moderation
423361
subject: 'OSF Account Verification, {provider_name}'
424362
__docs__: ...
@@ -447,14 +385,6 @@ notification_types:
447385
template: 'website/templates/reviews_resubmission_confirmation.html.mako'
448386
tests: ['osf_tests/test_reviewable.py']
449387

450-
#### NODE
451-
- name: node_wiki_updated
452-
subject: 'Wiki Updated'
453-
__docs__: ...
454-
object_content_type_model_name: abstractnode
455-
template: 'website/templates/file_updated.html.mako'
456-
tests: ['tests/test_events.py']
457-
458388
- name: node_file_updated
459389
subject: 'Files Updated'
460390
__docs__: ...
@@ -481,7 +411,7 @@ notification_types:
481411
__docs__: ...
482412
object_content_type_model_name: abstractnode
483413
template: 'website/templates/contributor_added_access_request.html.mako'
484-
tests: []
414+
tests: ['tests/test_claim_views.py', 'api_tests/requests/views/test_request_actions_create.py', 'api_tests/requests/mixins.py', 'osf_tests/test_institutional_admin_contributors.py']
485415

486416
- name: node_pending_registration_admin
487417
subject: 'Pending Registration - Admin Notification'
@@ -603,26 +533,13 @@ notification_types:
603533
template: 'website/templates/updates_rejected.html.mako'
604534
tests: ['osf_tests/test_schema_responses.py']
605535

606-
- name: node_archive_file_not_found_desk
607-
subject: 'Problem registering {src_title}'
608-
__docs__: ...
609-
object_content_type_model_name: abstractnode
610-
template: 'website/templates/archive_file_not_found_desk.html.mako'
611-
tests: []
612-
613-
- name: node_archive_file_not_found_user
536+
- name: user_archive_job_file_not_found
614537
subject: 'Registration failed because of altered files'
615538
object_content_type_model_name: abstractnode
616539
template: 'website/templates/archive_file_not_found_user.html.mako'
617540
tests: []
618541

619-
- name: node_archive_uncaught_error_desk
620-
subject: 'Problem registering {src_title}'
621-
object_content_type_model_name: abstractnode
622-
template: 'website/templates/archive_uncaught_error_desk.html.mako'
623-
tests: []
624-
625-
- name: node_archive_registration_stuck_desk
542+
- name: desk_archive_registration_stuck
626543
subject: '[auto] Stuck registrations audit'
627544
object_content_type_model_name: abstractnode
628545
template: 'website/templates/archive_registration_stuck_desk.html.mako'
@@ -634,18 +551,10 @@ notification_types:
634551
template: 'website/templates/archive_success.html.mako'
635552
tests: []
636553

637-
- name: node_withdraw_registration_approved
638-
object_content_type_model_name: abstractnode
639-
template: 'website/templates/withdrawal_request_granted.html.mako'
640-
641554
- name: node_withdrawal_request_approved
642555
object_content_type_model_name: abstractnode
643556
template: 'website/templates/withdrawal_request_granted.html.mako'
644557

645-
- name: node_withdraw_registration_declined
646-
object_content_type_model_name: abstractnode
647-
template: 'website/templates/withdrawal_request_declined.html.mako'
648-
649558
- name: node_new_public_project
650559
subject: 'Now, public. Next, impact.'
651560
__docs__: ...
@@ -683,18 +592,6 @@ notification_types:
683592
template: 'website/templates/contributor_added_preprints.html.mako'
684593
tests: ['api_tests/preprints/views/test_preprint_contributors_list.py']
685594

686-
- name: preprint_withdrawal_request_granted
687-
subject: 'Your {document_type} has been withdrawn'
688-
object_content_type_model_name: preprint
689-
template: 'website/templates/withdrawal_request_granted.html.mako'
690-
tests: []
691-
692-
- name: preprint_withdrawal_request_declined
693-
subject: 'Your withdrawal request has been declined'
694-
object_content_type_model_name: preprint
695-
template: 'website/templates/withdrawal_request_declined.html.mako'
696-
tests: []
697-
698595
#### SUPPORT
699596
#### Collection Submissions
700597
- name: collection_submission_removed_moderator
@@ -789,13 +686,6 @@ notification_types:
789686
template: 'website/templates/archive_uncaught_error_desk.html.mako'
790687
tests: []
791688

792-
- name: desk_osf_support_email
793-
subject: 'OSF Support Email'
794-
__docs__: ...
795-
object_content_type_model_name: desk
796-
template: 'website/templates/crossref_doi_error.html.mako'
797-
tests: []
798-
799689
- name: desk_request_deactivation
800690
subject: 'Deactivation Request'
801691
__docs__: ...

osf/management/commands/deactivate_requested_accounts.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def deactivate_requested_accounts(dry_run=True):
2929
'user_username': user.username,
3030
}
3131
)
32+
# TODO: Should ask PO whether we should send USER_REQUEST_DEACTIVATION mail
3233
else:
3334
logger.info(f'Disabling user {user._id}.')
3435
if not dry_run:

osf/models/notification_type.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ class NotificationTypeEnum(str, Enum):
3535
USER_PENDING_VERIFICATION_REGISTERED = 'user_pending_verification_registered'
3636
USER_STORAGE_CAP_EXCEEDED_ANNOUNCEMENT = 'user_storage_cap_exceeded_announcement'
3737
USER_SPAM_BANNED = 'user_spam_banned'
38+
USER_REQUEST_DEACTIVATION = 'user_request_deactivation'
3839
USER_REQUEST_DEACTIVATION_COMPLETE = 'user_request_deactivation_complete'
3940
USER_PRIMARY_EMAIL_CHANGED = 'user_primary_email_changed'
4041
USER_INSTITUTION_DEACTIVATION = 'user_institution_deactivation'
@@ -46,6 +47,7 @@ class NotificationTypeEnum(str, Enum):
4647
USER_REGISTRATION_BULK_UPLOAD_SUCCESS_PARTIAL = 'user_registration_bulk_upload_success_partial'
4748
USER_REGISTRATION_BULK_UPLOAD_SUCCESS_ALL = 'user_registration_bulk_upload_success_all'
4849
USER_ADD_SSO_EMAIL_OSF4I = 'user_add_sso_email_osf4i'
50+
USER_WELCOME = 'user_welcome' # waiting for the language from the PO
4951
USER_WELCOME_OSF4I = 'user_welcome_osf4i'
5052
USER_ARCHIVE_JOB_EXCEEDED = 'user_archive_job_exceeded'
5153
USER_ARCHIVE_JOB_COPY_ERROR = 'user_archive_job_copy_error'
@@ -66,10 +68,7 @@ class NotificationTypeEnum(str, Enum):
6668
USER_INVITE_OSF_PREPRINT = 'user_invite_osf_preprint'
6769
USER_ARCHIVE_JOB_UNCAUGHT_ERROR = 'user_archive_job_uncaught_error'
6870
USER_INSTITUTIONAL_ACCESS_REQUEST = 'user_institutional_access_request'
69-
USER_CAMPAIGN_CONFIRM_PREPRINTS_BRANDED = 'user_campaign_confirm_preprint_branded'
70-
USER_CAMPAIGN_CONFIRM_PREPRINTS_OSF = 'user_campaign_confirm_preprint_osf'
7171
USER_CAMPAIGN_CONFIRM_EMAIL_AGU_CONFERENCE = 'user_campaign_confirm_email_agu_conference'
72-
USER_CAMPAIGN_CONFIRM_EMAIL_AGU_CONFERENCE_2023 = 'user_campaign_confirm_email_agu_conference_2023'
7372
USER_CAMPAIGN_CONFIRM_EMAIL_REGISTRIES_OSF = 'user_campaign_confirm_email_registries_osf'
7473
USER_CAMPAIGN_CONFIRM_EMAIL_ERPC = 'user_campaign_confirm_email_erpc'
7574
USER_DIGEST = 'user_digest'
@@ -78,10 +77,12 @@ class NotificationTypeEnum(str, Enum):
7877
USER_NO_ADDON = 'user_no_addon'
7978
USER_SPAM_FILES_DETECTED = 'user_spam_files_detected'
8079
USER_CROSSREF_DOI_PENDING = 'user_crossref_doi_pending'
80+
USER_TERMS_OF_USE_UPDATED = 'user_terms_of_use_updated'
8181

8282
# Node notifications
8383
NODE_FILE_UPDATED = 'node_file_updated'
8484
NODE_AFFILIATION_CHANGED = 'node_affiliation_changed'
85+
NODE_ARCHIVE_SUCCESS = 'node_archive_success'
8586
NODE_REQUEST_ACCESS_SUBMITTED = 'node_request_access_submitted'
8687
NODE_REQUEST_ACCESS_DENIED = 'node_request_access_denied'
8788
NODE_FORK_COMPLETED = 'node_fork_completed'

0 commit comments

Comments
 (0)