Skip to content

Commit

Permalink
udated registration form
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramu Nerella authored and Ramu Nerella committed Aug 10, 2021
1 parent be9a1e1 commit 19380d7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
11 changes: 9 additions & 2 deletions fence/blueprints/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,22 @@ def register_user():
raise UserError("Form validation failed: {}".format(str(form.errors)))

# Validation passed--don't check form data here.
name = flask.request.form["name"]
# name = flask.request.form["name"]
firstname = flask.request.form["firstname"]
lastname = flask.request.form["lastname"]
org = flask.request.form["organization"]
email = flask.g.user.email or flask.request.form["email"]

combined_info = {}
if flask.g.user.additional_info is not None:
combined_info.update(flask.g.user.additional_info)
registration_info = {
"registration_info": {"name": name, "org": org, "email": email}
"registration_info": {
"firstname": firstname,
"lastname": lastname,
"org": org,
"email": email,
}
}
combined_info.update(registration_info)
flask.g.user.additional_info = combined_info
Expand Down
3 changes: 2 additions & 1 deletion fence/templates/register_user.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ <h1>{% block title %}Register{% endblock %}</h1>
<h1 class="introduction">Register in order to get access to download data</h1>
{{ form.csrf_token }}
<ul>
<li> {{ form.name.label }} {{ form.name }} </li>
<li> {{ form.firstname.label }} {{ form.firstname }} </li>
<li> {{ form.lastname.label }} {{ form.lastname }} </li>
<li> {{ form.organization.label }} {{ form.organization }} </li>
<li>
{% if user.email %}
Expand Down

0 comments on commit 19380d7

Please sign in to comment.