EMAIL_REGEX complied and css updates

This commit is contained in:
Beverly Nguyen
2025-11-06 11:16:44 -08:00
parent 710d991579
commit f5ae07aa0c
4 changed files with 13 additions and 7 deletions

View File

@@ -1,4 +1,4 @@
(function() {
(function(window) {
'use strict';
function scrollToElement(element, delay) {
@@ -65,4 +65,4 @@
window.OrganizationDashboard = {
highlightAndScrollToService: highlightAndScrollToService
};
})();
})(window);

View File

@@ -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;

View File

@@ -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)

View File

@@ -120,7 +120,7 @@
value="{{ edit_service_data.primary_contact|default('') }}" placeholder="email@example.com">
</div>
<fieldset class="usa-fieldset">
<fieldset class="usa-fieldset margin-top-2">
<legend class="usa-legend">Service Status</legend>
<div class="usa-radio">
<input class="usa-radio__input" id="statusTrial" type="radio" name="status" value="trial"