Merge branch 'main' into za/1075-generate-csvs-to-publish

This commit is contained in:
zandercymatics 2023-11-29 08:38:53 -07:00
commit ff37e510f1
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
41 changed files with 1828 additions and 154 deletions

View file

@ -3,6 +3,9 @@ import os
from django.apps import apps
from django.views.decorators.http import require_http_methods
from django.http import FileResponse, HttpResponse, JsonResponse
from django.utils.safestring import mark_safe
from registrar.templatetags.url_helpers import public_site_url
import requests
from login_required import login_not_required
@ -18,8 +21,13 @@ DOMAIN_API_MESSAGES = {
" For example, if you want www.city.gov, you would enter “city”"
" (without the quotes).",
"extra_dots": "Enter the .gov domain you want without any periods.",
"unavailable": "That domain isnt available. Try entering another one."
" Contact us if you need help coming up with a domain.",
# message below is considered safe; no user input can be inserted into the message
# body; public_site_url() function reads from local app settings and therefore safe
"unavailable": mark_safe( # nosec
"That domain isnt available. "
"<a class='usa-link' href='{}' target='_blank'>"
"Read more about choosing your .gov domain.</a>".format(public_site_url("domains/choosing"))
),
"invalid": "Enter a domain using only letters, numbers, or hyphens (though we don't recommend using hyphens).",
"success": "That domain is available!",
"error": "Error finding domain availability.",