Skip to content

Commit c755616

Browse files
authored
Merge pull request #8512 from Couchers-org/backend/feature/disable-strong-verification-reminder
Disable strong verification reminder on dashboard
2 parents 5ee0001 + 73fff5c commit c755616

4 files changed

Lines changed: 2 additions & 31 deletions

File tree

app/backend/src/couchers/servicers/account.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
from couchers.experimentation import check_gate
3131
from couchers.helpers.completed_profile import has_completed_profile
3232
from couchers.helpers.geoip import geoip_approximate_location
33-
from couchers.helpers.strong_verification import get_strong_verification_fields, has_strong_verification
33+
from couchers.helpers.strong_verification import get_strong_verification_fields
3434
from couchers.jobs.enqueue import queue_job
3535
from couchers.jobs.handlers import finalize_strong_verification
3636
from couchers.materialized_views import LiteUser
@@ -776,11 +776,6 @@ def GetReminders(
776776
if not has_completed_profile(session, user):
777777
reminders.append(account_pb2.Reminder(complete_profile_reminder=account_pb2.CompleteProfileReminder()))
778778

779-
if not has_strong_verification(session, user):
780-
reminders.append(
781-
account_pb2.Reminder(complete_verification_reminder=account_pb2.CompleteVerificationReminder())
782-
)
783-
784779
return account_pb2.GetRemindersRes(reminders=reminders)
785780

786781
def GetMyVolunteerInfo(

app/backend/src/tests/test_account.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -997,7 +997,6 @@ def test_ListInviteCodes(db):
997997

998998

999999
def test_reminders(db, moderator):
1000-
# the strong verification reminder's absence is tested in test_strong_verification.py
10011000
# reference writing reminders tested in test_AvailableWriteReferences_and_ListPendingReferencesToWrite
10021001
# we use LiteUser, so remember to refresh materialized views
10031002
user, token = generate_user(complete_profile=False)
@@ -1007,13 +1006,10 @@ def test_reminders(db, moderator):
10071006

10081007
refresh_materialized_views_rapid(empty_pb2.Empty())
10091008
with account_session(complete_token) as account:
1010-
assert [reminder.WhichOneof("reminder") for reminder in account.GetReminders(empty_pb2.Empty()).reminders] == [
1011-
"complete_verification_reminder"
1012-
]
1009+
assert [reminder.WhichOneof("reminder") for reminder in account.GetReminders(empty_pb2.Empty()).reminders] == []
10131010
with account_session(token) as account:
10141011
assert [reminder.WhichOneof("reminder") for reminder in account.GetReminders(empty_pb2.Empty()).reminders] == [
10151012
"complete_profile_reminder",
1016-
"complete_verification_reminder",
10171013
]
10181014

10191015
today_plus_2 = (today() + timedelta(days=2)).isoformat()
@@ -1034,7 +1030,6 @@ def test_reminders(db, moderator):
10341030
assert [reminder.WhichOneof("reminder") for reminder in reminders] == [
10351031
"respond_to_host_request_reminder",
10361032
"complete_profile_reminder",
1037-
"complete_verification_reminder",
10381033
]
10391034
assert reminders[0].respond_to_host_request_reminder.host_request_id == host_request1_id
10401035
assert reminders[0].respond_to_host_request_reminder.surfer_user.user_id == req_user1.id
@@ -1057,7 +1052,6 @@ def test_reminders(db, moderator):
10571052
"respond_to_host_request_reminder",
10581053
"respond_to_host_request_reminder",
10591054
"complete_profile_reminder",
1060-
"complete_verification_reminder",
10611055
]
10621056
assert reminders[0].respond_to_host_request_reminder.host_request_id == host_request1_id
10631057
assert reminders[0].respond_to_host_request_reminder.surfer_user.user_id == req_user1.id
@@ -1083,7 +1077,6 @@ def test_reminders(db, moderator):
10831077
"respond_to_host_request_reminder",
10841078
"respond_to_host_request_reminder",
10851079
"complete_profile_reminder",
1086-
"complete_verification_reminder",
10871080
]
10881081
assert reminders[0].respond_to_host_request_reminder.host_request_id == host_request1_id
10891082
assert reminders[0].respond_to_host_request_reminder.surfer_user.user_id == req_user1.id
@@ -1107,7 +1100,6 @@ def test_reminders(db, moderator):
11071100
"respond_to_host_request_reminder",
11081101
"respond_to_host_request_reminder",
11091102
"complete_profile_reminder",
1110-
"complete_verification_reminder",
11111103
]
11121104
assert reminders[0].respond_to_host_request_reminder.host_request_id == host_request2_id
11131105
assert reminders[0].respond_to_host_request_reminder.surfer_user.user_id == req_user2.id

app/backend/src/tests/test_references.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,6 @@ def test_AvailableWriteReferences_and_ListPendingReferencesToWrite(db, moderator
11401140
"write_reference_reminder",
11411141
"write_reference_reminder",
11421142
"write_reference_reminder",
1143-
"complete_verification_reminder",
11441143
]
11451144
assert reminders[0].write_reference_reminder.host_request_id == hr3
11461145
assert reminders[0].write_reference_reminder.reference_type == references_pb2.REFERENCE_TYPE_HOSTED

app/backend/src/tests/test_strong_verification.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -368,11 +368,6 @@ def test_strong_verification_happy_path(db, monkeypatch):
368368
api.GetLiteUser(api_pb2.GetLiteUserReq(user=user.username)).has_strong_verification
369369
== res.has_strong_verification
370370
)
371-
with account_session(token) as account:
372-
assert not any(
373-
reminder.HasField("complete_verification_reminder")
374-
for reminder in account.GetReminders(empty_pb2.Empty()).reminders
375-
)
376371

377372
# check has_passport_sex_gender_exception
378373
with real_admin_session(superuser_token) as admin:
@@ -400,11 +395,6 @@ def test_strong_verification_happy_path(db, monkeypatch):
400395
api.GetLiteUser(api_pb2.GetLiteUserReq(user=user.username)).has_strong_verification
401396
== res.has_strong_verification
402397
)
403-
with account_session(token) as account:
404-
assert not any(
405-
reminder.HasField("complete_verification_reminder")
406-
for reminder in account.GetReminders(empty_pb2.Empty()).reminders
407-
)
408398

409399
with real_admin_session(superuser_token) as admin:
410400
res = admin.GetUserDetails(admin_pb2.GetUserDetailsReq(user=user.username))
@@ -431,11 +421,6 @@ def test_strong_verification_happy_path(db, monkeypatch):
431421
api.GetLiteUser(api_pb2.GetLiteUserReq(user=user.username)).has_strong_verification
432422
== res.has_strong_verification
433423
)
434-
with account_session(token) as account:
435-
assert any(
436-
reminder.HasField("complete_verification_reminder")
437-
for reminder in account.GetReminders(empty_pb2.Empty()).reminders
438-
)
439424

440425
with real_admin_session(superuser_token) as admin:
441426
res = admin.GetUserDetails(admin_pb2.GetUserDetailsReq(user=user.username))

0 commit comments

Comments
 (0)