Skip to content

Commit

Permalink
Merge pull request #17 from sennetconsortium/yuanzhou/disable-match
Browse files Browse the repository at this point in the history
Yuanzhou/disable match
  • Loading branch information
yuanzhou authored Jan 2, 2024
2 parents 5116a41 + 5cb03a2 commit 3ec761a
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 32 deletions.
7 changes: 6 additions & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1868,8 +1868,13 @@ def registrations(globus_user_id):
return show_admin_error("This stage user does not exist!")
else:
# Check if there's any matching profiles in the `wp_connections` found
matching_profiles = get_matching_profiles(stage_user.last_name, stage_user.first_name, stage_user.email, stage_user.organization)
# Disabled by Zhou on 1/2/2024 to prevent decoding issue
# No longer need this matching profile feature for new members.
# matching_profiles = get_matching_profiles(stage_user.last_name, stage_user.first_name, stage_user.email, stage_user.organization)
#pprint(vars(list(matching_profiles)[0]))

# Use an empty list for all new registrations - Zhou 1/2/2024
matching_profiles = []
context = {
'isAuthenticated': True,
'username': session['name'],
Expand Down
58 changes: 27 additions & 31 deletions templates/individual_registration.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,12 @@ <h5 class="modal-title" id="exampleModalLongTitle">Deny registration</h5>
</div>


<!-- Disabled profile matching by Zhou 1/2/2024 -->
{% if data.matching_profiles|length > 0 %}

<div class="card mt-4">
<h5 class="card-header">Possible Existing Matching Profile</h5>
<div class="card-body">


{% if data.matching_profiles|length > 0 %}

{#
<div class="alert alert-info" role="alert">
Expand Down Expand Up @@ -178,8 +178,8 @@ <h5 class="card-header">Possible Existing Matching Profile</h5>
</tr>
</thead>
<tbody>
{% for profile in data.matching_profiles %}
<tr>
{% for profile in data.matching_profiles %}
<tr>
<th scope="row">{{ loop.index }}</th>
<td>{{ profile.first_name }}</td>
<td>{{ profile.last_name }}</td>
Expand All @@ -193,36 +193,32 @@ <h5 class="card-header">Possible Existing Matching Profile</h5>
</tr>

<!-- Approve by match Modal -->
<div class="modal fade" id="approve_by_match_modal_{{ loop.index }}" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLongTitle">Approve registraiton by using this matched profile</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
Are you sure you want to approve this registration by using the matched profile?
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<a href="{{ config['FLASK_APP_BASE_URI'] }}/match/{{ data.stage_user.globus_user_id }}/{{ profile.id }}" class="btn btn-primary">Yes, approve by using matched profile</a>
</div>
</div>
</div>
</div>
{% endfor %}
<div class="modal fade" id="approve_by_match_modal_{{ loop.index }}" tabindex="-1" role="dialog" aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLongTitle">Approve registraiton by using this matched profile</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
Are you sure you want to approve this registration by using the matched profile?
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
<a href="{{ config['FLASK_APP_BASE_URI'] }}/match/{{ data.stage_user.globus_user_id }}/{{ profile.id }}" class="btn btn-primary">Yes, approve by using matched profile</a>
</div>
</div>
</div>
</div>
{% endfor %}
</tbody>
</table>
{% else %}
<div class="alert alert-info" role="alert">
No matching profiles found.
</div>
{% endif %}

</div>
</div>

{% endif %}



Expand Down

0 comments on commit 3ec761a

Please sign in to comment.