Skip to content

Commit

Permalink
Merge pull request #739 from praekeltfoundation/fix-change-location
Browse files Browse the repository at this point in the history
Fix change location metadata
  • Loading branch information
erikh360 authored Feb 5, 2024
2 parents 0835cba + fad1ae0 commit 30ce327
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions yal/change_preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,8 @@ async def state_get_updated_description_from_coords(self):
return await self.go_to_state("state_display_preferences")

metadata = self.user.metadata
latitude = metadata.get("latitude")
longitude = metadata.get("longitude")
latitude = metadata.get("new_latitude")
longitude = metadata.get("new_longitude")

logger.debug(f"{latitude},{longitude}")

Expand Down
5 changes: 5 additions & 0 deletions yal/tests/test_change_preferences.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json
from urllib import parse

import pytest
from sanic import Sanic, response
Expand Down Expand Up @@ -702,6 +703,10 @@ async def test_state_update_location_confirm(tester: AppTester, google_api_mock)
"/maps/api/geocode/json"
]

request = google_api_mock.tstate.requests[0]
params = dict(parse.parse_qsl(parse.urlsplit(request.url).query))
assert params["latlng"] == "56.78,12.34"

tester.assert_num_messages(1)
tester.assert_message(
"\n".join(
Expand Down

0 comments on commit 30ce327

Please sign in to comment.