From f9169fcbcb2dba5fc2314c3c8fa0ec6f3f247b90 Mon Sep 17 00:00:00 2001 From: Andrew Shumway Date: Mon, 3 Jun 2024 15:55:37 -0600 Subject: [PATCH 01/13] poetry lock --- poetry.lock | 1 - 1 file changed, 1 deletion(-) diff --git a/poetry.lock b/poetry.lock index a3b6f718b..0a403642d 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1614,7 +1614,6 @@ files = [ {file = "msgpack-1.0.8-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5fbb160554e319f7b22ecf530a80a3ff496d38e8e07ae763b9e82fadfe96f273"}, {file = "msgpack-1.0.8-cp39-cp39-win32.whl", hash = "sha256:f9af38a89b6a5c04b7d18c492c8ccf2aee7048aff1ce8437c4683bb5a1df893d"}, {file = "msgpack-1.0.8-cp39-cp39-win_amd64.whl", hash = "sha256:ed59dd52075f8fc91da6053b12e8c89e37aa043f8986efd89e61fae69dc1b011"}, - {file = "msgpack-1.0.8-py3-none-any.whl", hash = "sha256:24f727df1e20b9876fa6e95f840a2a2651e34c0ad147676356f4bf5fbb0206ca"}, {file = "msgpack-1.0.8.tar.gz", hash = "sha256:95c02b0e27e706e48d0e5426d1710ca78e0f0628d6e89d5b5a5b91a5f12274f3"}, ] From ea8cfbdadb811cfd61a25ebd25fd11881d932ed7 Mon Sep 17 00:00:00 2001 From: Andrew Shumway Date: Thu, 13 Jun 2024 10:43:46 -0600 Subject: [PATCH 02/13] poetry lock --- poetry.lock | 116 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 115 insertions(+), 1 deletion(-) diff --git a/poetry.lock b/poetry.lock index 5fa01c2b7..d3ccee41e 100644 --- a/poetry.lock +++ b/poetry.lock @@ -85,6 +85,17 @@ charset-normalizer = ["charset-normalizer"] html5lib = ["html5lib"] lxml = ["lxml"] +[[package]] +name = "bidict" +version = "0.23.1" +description = "The bidirectional mapping library for Python." +optional = false +python-versions = ">=3.8" +files = [ + {file = "bidict-0.23.1-py3-none-any.whl", hash = "sha256:5dae8d4d79b552a71cbabc7deb25dfe8ce710b17ff41711e13010ead2abfc3e5"}, + {file = "bidict-0.23.1.tar.gz", hash = "sha256:03069d763bc387bbd20e7d49914e75fc4132a41937fa3405417e1a5a2d006d71"}, +] + [[package]] name = "black" version = "24.4.2" @@ -887,6 +898,24 @@ redis = ">=2.7.6" dev = ["coverage", "pre-commit", "pytest", "pytest-mock"] tests = ["coverage", "pytest", "pytest-mock"] +[[package]] +name = "flask-socketio" +version = "5.3.6" +description = "Socket.IO integration for Flask applications" +optional = false +python-versions = ">=3.6" +files = [ + {file = "Flask-SocketIO-5.3.6.tar.gz", hash = "sha256:bb8f9f9123ef47632f5ce57a33514b0c0023ec3696b2384457f0fcaa5b70501c"}, + {file = "Flask_SocketIO-5.3.6-py3-none-any.whl", hash = "sha256:9e62d2131842878ae6bfdd7067dfc3be397c1f2b117ab1dc74e6fe74aad7a579"}, +] + +[package.dependencies] +Flask = ">=0.9" +python-socketio = ">=5.0.2" + +[package.extras] +docs = ["sphinx"] + [[package]] name = "flask-talisman" version = "1.1.0" @@ -1049,6 +1078,17 @@ setproctitle = ["setproctitle"] testing = ["coverage", "eventlet", "gevent", "pytest", "pytest-cov"] tornado = ["tornado (>=0.2)"] +[[package]] +name = "h11" +version = "0.14.0" +description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1" +optional = false +python-versions = ">=3.7" +files = [ + {file = "h11-0.14.0-py3-none-any.whl", hash = "sha256:e3fe4ac4b851c468cc8363d500db52c2ead036020723024a109d37346efaa761"}, + {file = "h11-0.14.0.tar.gz", hash = "sha256:8f19fbbe99e72420ff35c00b27a34cb9937e902a8b810e2c88300c6f0a3b699d"}, +] + [[package]] name = "html5lib" version = "1.1" @@ -1304,9 +1344,13 @@ files = [ {file = "lxml-5.2.2-cp36-cp36m-win_amd64.whl", hash = "sha256:edcfa83e03370032a489430215c1e7783128808fd3e2e0a3225deee278585196"}, {file = "lxml-5.2.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:28bf95177400066596cdbcfc933312493799382879da504633d16cf60bba735b"}, {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3a745cc98d504d5bd2c19b10c79c61c7c3df9222629f1b6210c0368177589fb8"}, + {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1b590b39ef90c6b22ec0be925b211298e810b4856909c8ca60d27ffbca6c12e6"}, {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b336b0416828022bfd5a2e3083e7f5ba54b96242159f83c7e3eebaec752f1716"}, + {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_28_aarch64.whl", hash = "sha256:c2faf60c583af0d135e853c86ac2735ce178f0e338a3c7f9ae8f622fd2eb788c"}, {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_28_x86_64.whl", hash = "sha256:4bc6cb140a7a0ad1f7bc37e018d0ed690b7b6520ade518285dc3171f7a117905"}, + {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:7ff762670cada8e05b32bf1e4dc50b140790909caa8303cfddc4d702b71ea184"}, {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:57f0a0bbc9868e10ebe874e9f129d2917750adf008fe7b9c1598c0fbbfdde6a6"}, + {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:a6d2092797b388342c1bc932077ad232f914351932353e2e8706851c870bca1f"}, {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:60499fe961b21264e17a471ec296dcbf4365fbea611bf9e303ab69db7159ce61"}, {file = "lxml-5.2.2-cp37-cp37m-win32.whl", hash = "sha256:d9b342c76003c6b9336a80efcc766748a333573abf9350f4094ee46b006ec18f"}, {file = "lxml-5.2.2-cp37-cp37m-win_amd64.whl", hash = "sha256:b16db2770517b8799c79aa80f4053cd6f8b716f21f8aca962725a9565ce3ee40"}, @@ -2384,6 +2428,25 @@ files = [ [package.extras] cli = ["click (>=5.0)"] +[[package]] +name = "python-engineio" +version = "4.9.1" +description = "Engine.IO server and client for Python" +optional = false +python-versions = ">=3.6" +files = [ + {file = "python_engineio-4.9.1-py3-none-any.whl", hash = "sha256:f995e702b21f6b9ebde4e2000cd2ad0112ba0e5116ec8d22fe3515e76ba9dddd"}, + {file = "python_engineio-4.9.1.tar.gz", hash = "sha256:7631cf5563086076611e494c643b3fa93dd3a854634b5488be0bba0ef9b99709"}, +] + +[package.dependencies] +simple-websocket = ">=0.10.0" + +[package.extras] +asyncio-client = ["aiohttp (>=3.4)"] +client = ["requests (>=2.21.0)", "websocket-client (>=0.54.0)"] +docs = ["sphinx"] + [[package]] name = "python-json-logger" version = "2.0.7" @@ -2412,6 +2475,26 @@ text-unidecode = ">=1.3" [package.extras] unidecode = ["Unidecode (>=1.1.1)"] +[[package]] +name = "python-socketio" +version = "5.11.2" +description = "Socket.IO server and client for Python" +optional = false +python-versions = ">=3.8" +files = [ + {file = "python-socketio-5.11.2.tar.gz", hash = "sha256:ae6a1de5c5209ca859dc574dccc8931c4be17ee003e74ce3b8d1306162bb4a37"}, + {file = "python_socketio-5.11.2-py3-none-any.whl", hash = "sha256:b9f22a8ff762d7a6e123d16a43ddb1a27d50f07c3c88ea999334f2f89b0ad52b"}, +] + +[package.dependencies] +bidict = ">=0.21.0" +python-engineio = ">=4.8.0" + +[package.extras] +asyncio-client = ["aiohttp (>=3.4)"] +client = ["requests (>=2.21.0)", "websocket-client (>=0.54.0)"] +docs = ["sphinx"] + [[package]] name = "pytz" version = "2024.1" @@ -2766,6 +2849,23 @@ numpy = ">=1.14,<3" docs = ["matplotlib", "numpydoc (==1.1.*)", "sphinx", "sphinx-book-theme", "sphinx-remove-toctrees"] test = ["pytest", "pytest-cov"] +[[package]] +name = "simple-websocket" +version = "1.0.0" +description = "Simple WebSocket server and client for Python" +optional = false +python-versions = ">=3.6" +files = [ + {file = "simple-websocket-1.0.0.tar.gz", hash = "sha256:17d2c72f4a2bd85174a97e3e4c88b01c40c3f81b7b648b0cc3ce1305968928c8"}, + {file = "simple_websocket-1.0.0-py3-none-any.whl", hash = "sha256:1d5bf585e415eaa2083e2bcf02a3ecf91f9712e7b3e6b9fa0b461ad04e0837bc"}, +] + +[package.dependencies] +wsproto = "*" + +[package.extras] +docs = ["sphinx"] + [[package]] name = "six" version = "1.16.0" @@ -2943,6 +3043,20 @@ MarkupSafe = ">=2.1.1" [package.extras] watchdog = ["watchdog (>=2.3)"] +[[package]] +name = "wsproto" +version = "1.2.0" +description = "WebSockets state-machine based protocol implementation" +optional = false +python-versions = ">=3.7.0" +files = [ + {file = "wsproto-1.2.0-py3-none-any.whl", hash = "sha256:b9acddd652b585d75b20477888c56642fdade28bdfd3579aa24a4d2c037dd736"}, + {file = "wsproto-1.2.0.tar.gz", hash = "sha256:ad565f26ecb92588a3e43bc3d96164de84cd9902482b130d0ddbaa9664a85065"}, +] + +[package.dependencies] +h11 = ">=0.9.0,<1" + [[package]] name = "wtforms" version = "3.1.2" @@ -3001,4 +3115,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.12.2" -content-hash = "e96b87c048826ecb23d826c45b516aee60532cd2677a22332dc86fef498a411d" +content-hash = "ce5863177e0d58f7e4affdb2d7c4a23721a6eb3199183cd92874c0315c0d6afa" From b84d00bfb185c145ce3cb990c62a9fe1b506d54d Mon Sep 17 00:00:00 2001 From: Andrew Shumway Date: Fri, 2 Aug 2024 09:00:04 -0600 Subject: [PATCH 03/13] poetry lock --- poetry.lock | 1 - 1 file changed, 1 deletion(-) diff --git a/poetry.lock b/poetry.lock index 631540c19..56d622f3b 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1680,7 +1680,6 @@ files = [ {file = "msgpack-1.0.8-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5fbb160554e319f7b22ecf530a80a3ff496d38e8e07ae763b9e82fadfe96f273"}, {file = "msgpack-1.0.8-cp39-cp39-win32.whl", hash = "sha256:f9af38a89b6a5c04b7d18c492c8ccf2aee7048aff1ce8437c4683bb5a1df893d"}, {file = "msgpack-1.0.8-cp39-cp39-win_amd64.whl", hash = "sha256:ed59dd52075f8fc91da6053b12e8c89e37aa043f8986efd89e61fae69dc1b011"}, - {file = "msgpack-1.0.8-py3-none-any.whl", hash = "sha256:24f727df1e20b9876fa6e95f840a2a2651e34c0ad147676356f4bf5fbb0206ca"}, {file = "msgpack-1.0.8.tar.gz", hash = "sha256:95c02b0e27e706e48d0e5426d1710ca78e0f0628d6e89d5b5a5b91a5f12274f3"}, ] From 1eb54f825255b96699dbf218b61ad54b574e20b7 Mon Sep 17 00:00:00 2001 From: Jonathan Bobel Date: Fri, 16 Aug 2024 11:27:48 -0400 Subject: [PATCH 04/13] Activity chart updates --- app/assets/javascripts/activityChart.js | 33 +++++++++++++++++-- .../sass/uswds/_data-visualization.scss | 3 ++ 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/activityChart.js b/app/assets/javascripts/activityChart.js index d16d23827..da9c65e38 100644 --- a/app/assets/javascripts/activityChart.js +++ b/app/assets/javascripts/activityChart.js @@ -201,6 +201,8 @@ deliveredData = []; failedData = []; + let totalMessages = 0; + for (var dateString in data) { if (data.hasOwnProperty(dateString)) { const dateParts = dateString.split('-'); @@ -209,11 +211,38 @@ labels.push(formattedDate); deliveredData.push(data[dateString].sms.delivered); failedData.push(data[dateString].sms.failure); + + // Calculate the total number of messages + totalMessages += data[dateString].sms.delivered + data[dateString].sms.failure; } } - createChart('#weeklyChart', labels, deliveredData, failedData); - createTable('weeklyTable', 'activityChart', labels, deliveredData, failedData); + // Check if there are no messages sent + const subTitle = document.querySelector(`#activityChartContainer .chart-subtitle`); + if (totalMessages === 0) { + // Remove existing chart and render the alert message + d3.select('#weeklyChart').selectAll('*').remove(); + d3.select('#weeklyChart') + .append('div') + .html(` +
+
+

+ No messages sent in the last 7 days +

+
+
+ `); + // Hide the subtitle + if (subTitle) { + subTitle.style.display = 'none'; + } + } else { + // If there are messages, create the chart and table + createChart('#weeklyChart', labels, deliveredData, failedData); + createTable('weeklyTable', 'activityChart', labels, deliveredData, failedData); + } + return data; }) .catch(error => console.error('Error fetching daily stats:', error)); diff --git a/app/assets/sass/uswds/_data-visualization.scss b/app/assets/sass/uswds/_data-visualization.scss index 48c5f1256..e479334a3 100644 --- a/app/assets/sass/uswds/_data-visualization.scss +++ b/app/assets/sass/uswds/_data-visualization.scss @@ -9,6 +9,9 @@ $failed: color('gray-cool-20'); &.usage { height: units(4); } + svg { + overflow: visible; + } } #totalMessageChartContainer { From 6dc9efd13d82e2c3369e588b3fe8527ed09f4f6c Mon Sep 17 00:00:00 2001 From: Andrew Shumway Date: Fri, 16 Aug 2024 10:59:14 -0600 Subject: [PATCH 05/13] Poetry lock --- poetry.lock | 1 - 1 file changed, 1 deletion(-) diff --git a/poetry.lock b/poetry.lock index 865e6da97..d88d1d3cf 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2512,7 +2512,6 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, - {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, From 8b2a3c26fa2b5de3617b7fead5965c41e66e2ab5 Mon Sep 17 00:00:00 2001 From: Beverly Nguyen Date: Fri, 16 Aug 2024 11:01:00 -0700 Subject: [PATCH 06/13] changed download conditionals --- app/templates/views/activity/all-activity.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/templates/views/activity/all-activity.html b/app/templates/views/activity/all-activity.html index bd0843aa4..d952eb3a1 100644 --- a/app/templates/views/activity/all-activity.html +++ b/app/templates/views/activity/all-activity.html @@ -110,7 +110,7 @@ {% if job.time_left != "Data no longer available" %} File Download Icon - {% elif job %} + {% else %} N/A {% endif %} @@ -122,7 +122,7 @@ No batched job messages found (messages are kept for {{ service_data_retention_days }} days). - {% endif %} + {% endif %}
From 062eefcf7ae2d506afe749dcf1372edd4e575c70 Mon Sep 17 00:00:00 2001 From: Andrew Shumway Date: Mon, 19 Aug 2024 09:20:51 -0600 Subject: [PATCH 07/13] Add Andrew to dependabot assignee/review --- .github/dependabot.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 3e3ce01d3..6f1648480 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,6 +9,10 @@ updates: directory: "/" # Location of package manifests schedule: interval: "daily" + assignees: + - "A-Shumway42" + reviewers: + - "A-Shumway42" - package-ecosystem: "npm" directory: "/" schedule: From 672fed7e4bd04ad15ae3a92df94c7871359afd12 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Mon, 19 Aug 2024 10:57:08 -0700 Subject: [PATCH 08/13] initial --- app/main/views/user_profile.py | 40 +++++++++++++--------------- app/notify_client/user_api_client.py | 6 ++++- poetry.lock | 5 +--- 3 files changed, 25 insertions(+), 26 deletions(-) diff --git a/app/main/views/user_profile.py b/app/main/views/user_profile.py index b718bb484..f322873fa 100644 --- a/app/main/views/user_profile.py +++ b/app/main/views/user_profile.py @@ -189,32 +189,30 @@ def user_profile_mobile_number_delete(): @main.route("/user-profile/mobile-number/authenticate", methods=["GET", "POST"]) @user_is_logged_in def user_profile_mobile_number_authenticate(): - # Validate password for form - def _check_password(pwd): - return user_api_client.verify_password(current_user.id, pwd) - - form = ConfirmPasswordForm(_check_password) if NEW_MOBILE not in session: return redirect(url_for(".user_profile_mobile_number")) - if form.validate_on_submit(): - session[NEW_MOBILE_PASSWORD_CONFIRMED] = True - current_user.send_verify_code(to=session[NEW_MOBILE]) - create_mobile_number_change_event( - user_id=current_user.id, - updated_by_id=current_user.id, - original_mobile_number=current_user.mobile_number, - new_mobile_number=session[NEW_MOBILE], - ) - return redirect(url_for(".user_profile_mobile_number_confirm")) - - return render_template( - "views/user-profile/authenticate.html", - thing="mobile number", - form=form, - back_link=url_for(".user_profile_mobile_number_confirm"), + session[NEW_MOBILE_PASSWORD_CONFIRMED] = True + print(f"GOING TO SEND VERIFY CODE TO {session[NEW_MOBILE]}") + current_user.send_verify_code(to=session[NEW_MOBILE]) + create_mobile_number_change_event( + user_id=current_user.id, + updated_by_id=current_user.id, + original_mobile_number=current_user.mobile_number, + new_mobile_number=session[NEW_MOBILE], ) + print( + f"sent create_mobile_number_change_event original {current_user.mobile_number} new {session[NEW_MOBILE]}" + ) + return redirect(url_for(".user_profile_mobile_number_confirm")) + + # return render_template( + # "views/user-profile/authenticate.html", + # thing="mobile number", + # form=form, + # back_link=url_for(".user_profile_mobile_number_confirm"), + # ) @main.route("/user-profile/mobile-number/confirm", methods=["GET", "POST"]) diff --git a/app/notify_client/user_api_client.py b/app/notify_client/user_api_client.py index e47bc4030..40bd75acb 100644 --- a/app/notify_client/user_api_client.py +++ b/app/notify_client/user_api_client.py @@ -1,4 +1,5 @@ from flask import current_app +from app.utils import hilite from notifications_python_client.errors import HTTPError from app.notify_client import NotifyAdminAPIClient, cache @@ -109,13 +110,16 @@ class UserApiClient(NotifyAdminAPIClient): raise def send_verify_code(self, user_id, code_type, to, next_string=None): + print(hilite("SEND VERIFY CODE")) data = {"to": to} if next_string: data["next"] = next_string if code_type == "email": data["email_auth_link_host"] = self.admin_url + print(hilite(f"DATA {data}")) endpoint = "/user/{0}/{1}-code".format(user_id, code_type) - current_app.logger.warn(f"Sending verify_code {code_type} to {user_id}") + print(hilite(f"ENDPOINT {endpoint}")) + current_app.logger.warn(hilite(f"Sending verify_code {code_type} to {user_id}")) self.post(endpoint, data=data) def send_verify_email(self, user_id, to): diff --git a/poetry.lock b/poetry.lock index 52bab1a90..f44a2e0bf 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1285,13 +1285,9 @@ files = [ {file = "lxml-5.2.2-cp36-cp36m-win_amd64.whl", hash = "sha256:edcfa83e03370032a489430215c1e7783128808fd3e2e0a3225deee278585196"}, {file = "lxml-5.2.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:28bf95177400066596cdbcfc933312493799382879da504633d16cf60bba735b"}, {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3a745cc98d504d5bd2c19b10c79c61c7c3df9222629f1b6210c0368177589fb8"}, - {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1b590b39ef90c6b22ec0be925b211298e810b4856909c8ca60d27ffbca6c12e6"}, {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b336b0416828022bfd5a2e3083e7f5ba54b96242159f83c7e3eebaec752f1716"}, - {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_28_aarch64.whl", hash = "sha256:c2faf60c583af0d135e853c86ac2735ce178f0e338a3c7f9ae8f622fd2eb788c"}, {file = "lxml-5.2.2-cp37-cp37m-manylinux_2_28_x86_64.whl", hash = "sha256:4bc6cb140a7a0ad1f7bc37e018d0ed690b7b6520ade518285dc3171f7a117905"}, - {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:7ff762670cada8e05b32bf1e4dc50b140790909caa8303cfddc4d702b71ea184"}, {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:57f0a0bbc9868e10ebe874e9f129d2917750adf008fe7b9c1598c0fbbfdde6a6"}, - {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_2_aarch64.whl", hash = "sha256:a6d2092797b388342c1bc932077ad232f914351932353e2e8706851c870bca1f"}, {file = "lxml-5.2.2-cp37-cp37m-musllinux_1_2_x86_64.whl", hash = "sha256:60499fe961b21264e17a471ec296dcbf4365fbea611bf9e303ab69db7159ce61"}, {file = "lxml-5.2.2-cp37-cp37m-win32.whl", hash = "sha256:d9b342c76003c6b9336a80efcc766748a333573abf9350f4094ee46b006ec18f"}, {file = "lxml-5.2.2-cp37-cp37m-win_amd64.whl", hash = "sha256:b16db2770517b8799c79aa80f4053cd6f8b716f21f8aca962725a9565ce3ee40"}, @@ -1626,6 +1622,7 @@ files = [ {file = "msgpack-1.0.8-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5fbb160554e319f7b22ecf530a80a3ff496d38e8e07ae763b9e82fadfe96f273"}, {file = "msgpack-1.0.8-cp39-cp39-win32.whl", hash = "sha256:f9af38a89b6a5c04b7d18c492c8ccf2aee7048aff1ce8437c4683bb5a1df893d"}, {file = "msgpack-1.0.8-cp39-cp39-win_amd64.whl", hash = "sha256:ed59dd52075f8fc91da6053b12e8c89e37aa043f8986efd89e61fae69dc1b011"}, + {file = "msgpack-1.0.8-py3-none-any.whl", hash = "sha256:24f727df1e20b9876fa6e95f840a2a2651e34c0ad147676356f4bf5fbb0206ca"}, {file = "msgpack-1.0.8.tar.gz", hash = "sha256:95c02b0e27e706e48d0e5426d1710ca78e0f0628d6e89d5b5a5b91a5f12274f3"}, ] From 339797558a06dd139b5d6680db26b4b8897fae6f Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Mon, 19 Aug 2024 13:02:20 -0700 Subject: [PATCH 09/13] remove debug --- app/notify_client/user_api_client.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/notify_client/user_api_client.py b/app/notify_client/user_api_client.py index 40bd75acb..241b6c5d0 100644 --- a/app/notify_client/user_api_client.py +++ b/app/notify_client/user_api_client.py @@ -110,15 +110,13 @@ class UserApiClient(NotifyAdminAPIClient): raise def send_verify_code(self, user_id, code_type, to, next_string=None): - print(hilite("SEND VERIFY CODE")) + data = {"to": to} if next_string: data["next"] = next_string if code_type == "email": data["email_auth_link_host"] = self.admin_url - print(hilite(f"DATA {data}")) endpoint = "/user/{0}/{1}-code".format(user_id, code_type) - print(hilite(f"ENDPOINT {endpoint}")) current_app.logger.warn(hilite(f"Sending verify_code {code_type} to {user_id}")) self.post(endpoint, data=data) From 66a555a2d41883285b6242131fa338a1c146c2b7 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Mon, 19 Aug 2024 13:11:02 -0700 Subject: [PATCH 10/13] remove print statements --- app/main/views/user_profile.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/app/main/views/user_profile.py b/app/main/views/user_profile.py index f322873fa..0440a682d 100644 --- a/app/main/views/user_profile.py +++ b/app/main/views/user_profile.py @@ -194,7 +194,6 @@ def user_profile_mobile_number_authenticate(): return redirect(url_for(".user_profile_mobile_number")) session[NEW_MOBILE_PASSWORD_CONFIRMED] = True - print(f"GOING TO SEND VERIFY CODE TO {session[NEW_MOBILE]}") current_user.send_verify_code(to=session[NEW_MOBILE]) create_mobile_number_change_event( user_id=current_user.id, @@ -202,9 +201,6 @@ def user_profile_mobile_number_authenticate(): original_mobile_number=current_user.mobile_number, new_mobile_number=session[NEW_MOBILE], ) - print( - f"sent create_mobile_number_change_event original {current_user.mobile_number} new {session[NEW_MOBILE]}" - ) return redirect(url_for(".user_profile_mobile_number_confirm")) # return render_template( From f0ec9e3da93c6dd71ee5f43142f584392ffdc93e Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Mon, 19 Aug 2024 13:57:07 -0700 Subject: [PATCH 11/13] fix imports --- app/notify_client/user_api_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/notify_client/user_api_client.py b/app/notify_client/user_api_client.py index 241b6c5d0..01a3a78c9 100644 --- a/app/notify_client/user_api_client.py +++ b/app/notify_client/user_api_client.py @@ -1,8 +1,8 @@ from flask import current_app -from app.utils import hilite from notifications_python_client.errors import HTTPError from app.notify_client import NotifyAdminAPIClient, cache +from app.utils import hilite from app.utils.user_permissions import translate_permissions_from_ui_to_db ALLOWED_ATTRIBUTES = { From 03fae4d08f31ab601160af8e44043dcd066b9094 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Tue, 20 Aug 2024 07:14:45 -0700 Subject: [PATCH 12/13] fix test --- .ds.baseline | 6 +++--- tests/app/main/views/test_user_profile.py | 14 -------------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/.ds.baseline b/.ds.baseline index ae25ee978..41cd12948 100644 --- a/.ds.baseline +++ b/.ds.baseline @@ -601,7 +601,7 @@ "filename": "tests/app/main/views/test_user_profile.py", "hashed_secret": "8072d7aad32964ec43fbcb699c75dc38890792f7", "is_verified": false, - "line_number": 350, + "line_number": 336, "is_secret": false }, { @@ -609,7 +609,7 @@ "filename": "tests/app/main/views/test_user_profile.py", "hashed_secret": "4c9dbb972da179e4f66f023eaa5fb9451d835030", "is_verified": false, - "line_number": 351, + "line_number": 337, "is_secret": false } ], @@ -692,5 +692,5 @@ } ] }, - "generated_at": "2024-08-15T16:29:15Z" + "generated_at": "2024-08-20T14:14:36Z" } diff --git a/tests/app/main/views/test_user_profile.py b/tests/app/main/views/test_user_profile.py index 7e444478c..4fd2004cd 100644 --- a/tests/app/main/views/test_user_profile.py +++ b/tests/app/main/views/test_user_profile.py @@ -247,20 +247,6 @@ def test_should_redirect_after_mobile_number_change( assert session["new-mob"] == phone_number_to_register_with -def test_should_show_authenticate_after_mobile_number_change( - client_request, -): - with client_request.session_transaction() as session: - session["new-mob"] = "+12021234123" - - page = client_request.get( - "main.user_profile_mobile_number_authenticate", - ) - - assert "Change your mobile number" in page.text - assert "Confirm" in page.text - - def test_should_redirect_after_mobile_number_authenticate( client_request, mock_verify_password, From 3b1bd05a10abbd846dd3189fc4f3dc5cea8c0239 Mon Sep 17 00:00:00 2001 From: Kenneth Kehl <@kkehl@flexion.us> Date: Tue, 20 Aug 2024 13:52:47 -0700 Subject: [PATCH 13/13] remove commented out code --- app/main/views/user_profile.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/app/main/views/user_profile.py b/app/main/views/user_profile.py index 0440a682d..2efac8b23 100644 --- a/app/main/views/user_profile.py +++ b/app/main/views/user_profile.py @@ -203,13 +203,6 @@ def user_profile_mobile_number_authenticate(): ) return redirect(url_for(".user_profile_mobile_number_confirm")) - # return render_template( - # "views/user-profile/authenticate.html", - # thing="mobile number", - # form=form, - # back_link=url_for(".user_profile_mobile_number_confirm"), - # ) - @main.route("/user-profile/mobile-number/confirm", methods=["GET", "POST"]) @user_is_logged_in