Skip to content
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

Remove phone number from 409 checking #770

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions src/meshapi/tests/test_join_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,29 @@ def test_valid_join_form_with_member_confirmation(self, submission):
)
validate_successful_join_form_submission(self, "Valid Join Form", s, response)

def test_phone_number_is_silently_corrected(self):
self.requests_mocker.get(
NYC_PLANNING_LABS_GEOCODE_URL,
json=valid_join_form_submission["dob_addr_response"],
)

request, s = pull_apart_join_form_submission(valid_join_form_submission)

request["phone_number"] = "+1 585-75 8-3425"
request["trust_me_bro"] = False

response = self.c.post("/api/v1/join/", request, content_type="application/json")
code = 201
self.assertEqual(
code,
response.status_code,
f"status code incorrect for Valid Join Form. Should be {code}, but got {response.status_code}.\n Response is: {response.content.decode('utf-8')}",
)
validate_successful_join_form_submission(self, "Valid Join Form", s, response)

member = Member.objects.get(installs__install_number=response.json()["install_number"])
self.assertEqual(member.phone_number, "+1 585-758-3425")

def test_valid_join_form_aussie_intl_phone(self):
request, s = pull_apart_join_form_submission(valid_join_form_submission)

Expand Down
4 changes: 0 additions & 4 deletions src/meshapi/views/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,6 @@ def process_join_form(r: JoinFormRequest, request: Optional[Request] = None) ->

changed_info: dict[str, str | int] = {}

if formatted_phone_number and r.phone_number != formatted_phone_number:
logging.warning(f"Changed phone_number: {formatted_phone_number} != {r.phone_number}")
changed_info["phone_number"] = formatted_phone_number

if r.street_address != nyc_addr_info.street_address:
logging.warning(f"Changed street_address: {r.street_address} != {nyc_addr_info.street_address}")
changed_info["street_address"] = nyc_addr_info.street_address
Expand Down
Loading