Skip to content

BUG: UTILS Phone number validation throws a TypeError on vanity phone numbers #208

Open
@ChrisJohnson-CDJ

Description

@ChrisJohnson-CDJ

Description

  • Ticket is understood, and QA has been contacted (if the ticket has a QA label).
  • This work is added to the sprint review slide deck (key win bullet point and demo slide)

notifications_utils/recipients.py :: validate_phone_number

The phone number validation is throwing a TypeError when a vanity phone number is used (i.e. 1-800-DIG-SAFE).

This is causing POST v2/notifications/sms returns a 500 Internal Server Error instead of a 400 Bad Request Error: Not a valid number.

Although the normalized form of the vanity number is technically valid this format should probably be flagged as an invalid format.

Steps to Reproduce

  1. POST {{notification-api-url}}/v2/notifications/sms with a payload using a vanity number for the phone number

Image

Image

Image

Impact/Urgency

Making a POST request to send an sms notification with a vanity number will result in a 500 Internal Server Error

Expected Behavior

  • A validation error is returned with a 400 status code

QA Considerations

Additional Info & Resources

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions