mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-10 01:55:41 -04:00
notify-api-412 use black to enforce python coding style
This commit is contained in:
@@ -9,20 +9,23 @@ from app.main.forms import SearchByNameForm
|
||||
from app.utils.user import user_is_platform_admin
|
||||
|
||||
|
||||
@main.route("/find-services-by-name", methods=['GET', 'POST'])
|
||||
@main.route("/find-services-by-name", methods=["GET", "POST"])
|
||||
@user_is_platform_admin
|
||||
def find_services_by_name():
|
||||
form = SearchByNameForm()
|
||||
services_found = None
|
||||
if form.validate_on_submit():
|
||||
with suppress(ValueError):
|
||||
return redirect(url_for(
|
||||
'main.service_dashboard',
|
||||
service_id=uuid.UUID(form.search.data)
|
||||
))
|
||||
services_found = service_api_client.find_services_by_name(service_name=form.search.data)['data']
|
||||
return redirect(
|
||||
url_for(
|
||||
"main.service_dashboard", service_id=uuid.UUID(form.search.data)
|
||||
)
|
||||
)
|
||||
services_found = service_api_client.find_services_by_name(
|
||||
service_name=form.search.data
|
||||
)["data"]
|
||||
return render_template(
|
||||
'views/find-services/find-services-by-name.html',
|
||||
"views/find-services/find-services-by-name.html",
|
||||
form=form,
|
||||
services_found=services_found
|
||||
services_found=services_found,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user