mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-11 10:28:41 -04:00
Remove the temporary endpoint to create users.
This commit is contained in:
@@ -34,26 +34,3 @@ def process_sign_in():
|
|||||||
else:
|
else:
|
||||||
return jsonify(form.errors), 400
|
return jsonify(form.errors), 400
|
||||||
return redirect('/two-factor')
|
return redirect('/two-factor')
|
||||||
|
|
||||||
|
|
||||||
@main.route('/temp-create-users', methods=(['GET']))
|
|
||||||
def render_create_user():
|
|
||||||
return render_template('temp-create-users.html', form=LoginForm())
|
|
||||||
|
|
||||||
|
|
||||||
@main.route('/temp-create-users', methods=(['POST']))
|
|
||||||
def create_user_for_test():
|
|
||||||
form = LoginForm()
|
|
||||||
if form.validate_on_submit():
|
|
||||||
user = User(email_address=form.email_address.data,
|
|
||||||
name=form.email_address.data,
|
|
||||||
password=form.password.data,
|
|
||||||
created_at=datetime.now(),
|
|
||||||
mobile_number='+447651234534',
|
|
||||||
role_id=1)
|
|
||||||
users_dao.insert_user(user)
|
|
||||||
|
|
||||||
return redirect('/sign-in')
|
|
||||||
else:
|
|
||||||
print(form.errors)
|
|
||||||
return redirect(form.errors), 400
|
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
{% extends "admin_template.html" %}
|
|
||||||
|
|
||||||
{% block page_title %}
|
|
||||||
Temp create users
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
|
|
||||||
<div class="grid-row">
|
|
||||||
<div class="column-two-thirds">
|
|
||||||
<h1 class="heading-xlarge">Temporary page to create user</h1>
|
|
||||||
|
|
||||||
<p>This is a temporary page to create users, the name will be the same as the email address.</p>
|
|
||||||
|
|
||||||
<form autocomplete="off" action="" method="post">
|
|
||||||
{{ form.hidden_tag() }}
|
|
||||||
<p>
|
|
||||||
<label class="form-label">Email address</label>
|
|
||||||
{{ form.email_address(class="form-control-2-3", autocomplete="off") }} <br>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<label class="form-label">Password</label>
|
|
||||||
{{ form.password(class="form-control-1-4", autocomplete="off") }} <br>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p>
|
|
||||||
<button class="button" href="sign-in" role="button">Create User</button>
|
|
||||||
</p>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% endblock %}
|
|
||||||
Reference in New Issue
Block a user