Compare commits

...

5 Commits

Author SHA1 Message Date
ccostino
32df2afe0b Merge pull request #1601 from GSA/phone_fix
fix phone number changing
2025-03-14 16:13:44 -04:00
Kenneth Kehl
2370dfd2c1 revert debugging code 2025-03-14 09:03:52 -07:00
Kenneth Kehl
eaf6784236 fix phone number changing 2025-03-14 08:53:40 -07:00
ccostino
c45f37f0d2 Merge pull request #1600 from GSA/dependabot_fix
remove automerge script
2025-03-14 10:56:30 -04:00
Kenneth Kehl
458f1d7794 remove automerge script 2025-03-13 13:43:51 -07:00
4 changed files with 19 additions and 44 deletions

View File

@@ -1,36 +0,0 @@
name: Dependabot Auto-Merge
on:
pull_request_target:
types: [opened, synchronize, reopened]
permissions:
pull-requests: write # To approve PRs
contents: write # to merge PRs
jobs:
auto-merge:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]' # Only dependabot PRs
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Fetch Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Auto-approve dependabot PR
uses: hmarr/auto-approve-action@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Enable auto-merge for minor updates
if: steps.metadata.outputs.update-type == 'version-update:semver-minor'
run: |
gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -325,7 +325,14 @@ def batch_insert_notifications(self):
elif isinstance(notification_dict["created_at"], list):
notification_dict["created_at"] = notification_dict["created_at"][0]
notification = Notification(**notification_dict)
if notification is not None:
# notify-api-749 do not write to db
# if we have a verify_code we know this is the authentication notification at login time
# and not csv (containing PII) provided by the user, so allow verify_code to continue to exist
if notification is None:
continue
if "verify_code" in str(notification.personalisation):
pass
else:
batch.append(notification)
try:
dao_batch_insert_notifications(batch)

View File

@@ -42,12 +42,14 @@ def send_sms_to_provider(notification):
"""
# Take this path for report generation, where we know
# everything is in the cache.
personalisation = get_personalisation_from_s3(
notification.service_id,
notification.job_id,
notification.job_row_number,
)
notification.personalisation = personalisation
if "verify_code" not in str(notification.personalisation):
personalisation = get_personalisation_from_s3(
notification.service_id,
notification.job_id,
notification.job_row_number,
)
notification.personalisation = personalisation
service = SerialisedService.from_id(notification.service_id)
message_id = None
@@ -92,7 +94,6 @@ def send_sms_to_provider(notification):
recipient = None
# It is our 2facode, maybe
recipient = _get_verify_code(notification)
if recipient is None:
recipient = get_phone_number_from_s3(
notification.service_id,

View File

@@ -145,6 +145,9 @@ def persist_notification(
# it's just too hard with redis and timing to test this here
if os.getenv("NOTIFY_ENVIRONMENT") == "test":
dao_create_notification(notification)
elif "verify_code" in str(notification.personalisation):
dao_create_notification(notification)
else:
redis_store.rpush(
"message_queue",