From f5ae07aa0c8a3cf0c7f2fbde9800706097ef0615 Mon Sep 17 00:00:00 2001 From: Beverly Nguyen Date: Thu, 6 Nov 2025 11:16:44 -0800 Subject: [PATCH] EMAIL_REGEX complied and css updates --- app/assets/javascripts/organizationDashboard.js | 4 ++-- app/assets/sass/uswds/_uswds-theme-custom-styles.scss | 8 ++++++++ app/main/views/organizations.py | 6 ++---- app/templates/views/organizations/organization/index.html | 2 +- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/organizationDashboard.js b/app/assets/javascripts/organizationDashboard.js index cb85cef3c..07cd7e255 100644 --- a/app/assets/javascripts/organizationDashboard.js +++ b/app/assets/javascripts/organizationDashboard.js @@ -1,4 +1,4 @@ -(function() { +(function(window) { 'use strict'; function scrollToElement(element, delay) { @@ -65,4 +65,4 @@ window.OrganizationDashboard = { highlightAndScrollToService: highlightAndScrollToService }; -})(); +})(window); diff --git a/app/assets/sass/uswds/_uswds-theme-custom-styles.scss b/app/assets/sass/uswds/_uswds-theme-custom-styles.scss index 8bd2db31a..81b6a71f1 100644 --- a/app/assets/sass/uswds/_uswds-theme-custom-styles.scss +++ b/app/assets/sass/uswds/_uswds-theme-custom-styles.scss @@ -365,6 +365,14 @@ td.table-empty-message { } } +.usa-fieldset { + background-color: transparent; +} + +.usa-radio { + background-color: transparent; +} + .spark-bar-bar { font-size: units(2); background-color: transparent; diff --git a/app/main/views/organizations.py b/app/main/views/organizations.py index 4feb387d3..b9026f407 100644 --- a/app/main/views/organizations.py +++ b/app/main/views/organizations.py @@ -45,7 +45,7 @@ from app.utils.csv import Spreadsheet from app.utils.user import user_has_permissions, user_is_platform_admin from notifications_python_client.errors import HTTPError -EMAIL_REGEX = r"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$" +EMAIL_REGEX = re.compile(r"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$") @main.route("/organizations", methods=["GET"]) @@ -151,7 +151,7 @@ def _handle_edit_service(org_id, service_id): if not service_name: flash("Service name is required", "error") - elif primary_contact and not re.match(EMAIL_REGEX, primary_contact): + elif primary_contact and not EMAIL_REGEX.match(primary_contact): flash("Please enter a valid email address", "error") else: if service_name != service.name: @@ -339,8 +339,6 @@ def download_organization_usage_report(org_id): ] # Sanitize organization name for filename to prevent header injection - import re - safe_org_name = re.sub(r"[^\w\s-]", "", current_organization.name).strip() safe_org_name = re.sub(r"[-\s]+", "-", safe_org_name) diff --git a/app/templates/views/organizations/organization/index.html b/app/templates/views/organizations/organization/index.html index 91f5eda37..c7005df98 100644 --- a/app/templates/views/organizations/organization/index.html +++ b/app/templates/views/organizations/organization/index.html @@ -120,7 +120,7 @@ value="{{ edit_service_data.primary_contact|default('') }}" placeholder="email@example.com"> -
+
Service Status