mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-18 09:24:35 -05:00
The list of services this page was looking at only included those not belonging to an organisation. On production this excludes services we’ve added to organisations to make the management of those services easier (eg ‘GDS’ and ‘DVLA’).
39 lines
1.1 KiB
Python
39 lines
1.1 KiB
Python
from flask import render_template, request
|
|
from flask_login import login_required
|
|
|
|
from app import user_api_client
|
|
from app.main import main
|
|
from app.main.forms import SearchUsersByEmailForm
|
|
from app.utils import user_is_platform_admin
|
|
|
|
|
|
@main.route("/find-users-by-email", methods=['GET', 'POST'])
|
|
@login_required
|
|
@user_is_platform_admin
|
|
def find_users_by_email():
|
|
form = SearchUsersByEmailForm()
|
|
users_found = None
|
|
status = 200
|
|
if form.validate_on_submit():
|
|
users_found = user_api_client.find_users_by_full_or_partial_email(form.search.data)['data']
|
|
elif request.method == 'POST':
|
|
status = 400
|
|
return render_template(
|
|
'views/find-users/find-users-by-email.html',
|
|
form=form,
|
|
users_found=users_found
|
|
), status
|
|
|
|
|
|
@main.route("/users/<user_id>", methods=['GET'])
|
|
@login_required
|
|
@user_is_platform_admin
|
|
def user_information(user_id):
|
|
user = user_api_client.get_user(user_id)
|
|
services = user_api_client.get_services_for_user(user)
|
|
return render_template(
|
|
'views/find-users/user-information.html',
|
|
user=user,
|
|
services=services,
|
|
)
|