Commit 3792531a authored by marcosfelipp's avatar marcosfelipp
Browse files

Resend e-mail to user to ativate account

parent b73650b0
......@@ -65,14 +65,13 @@
</td>
{% else %}
<td> never activated </td>
<td></td>
<!-- <td>
<form class="form-horizontal" role="form" action="" method="post" id="enable_form_{{urn}}">
<td>
<form class="form-horizontal" role="form" action="" method="post" id="resend_email_{{attrs.email_address}}">
{% csrf_token %}
<input type="hidden" name="enable_member" value="{{urn}}">
<button class="btn btn-primary enable_member_btn">Activate</button>
<input type="hidden" name="resend_email" value="{{attrs.email_address}}">
<button class="btn btn-primary resend_email_btn">Resend email</button>
</form>
</td>-->
</td>
{% endif %}
</tr>
{% endfor %}
......
......@@ -434,6 +434,23 @@ def get_member_data_from_form(request, form, email=None):
return member_attrs
def resend_email(credential, member_email):
"""
This method calls the generate_and_send_activation_token method in order to resend
activation token to users email.
"""
threading.Thread(target=generate_and_send_activation_token,
args=(member_email,)).start()
# Set operation dictionary with delete status and message.
operation = {
'operation_status': "success",
'operation_message': "OK"}
# Return operation dictionary.
return operation
def enable_member(credential, member_urn):
"""
This method calls the update_member method in order to set
......
......@@ -48,6 +48,12 @@ def manage_members(request):
request.session['member_cred'], request.POST['enable_member'])
# Set context dictionary with the result of enable operation.
context.update(operation)
elif (request.method == 'POST' and 'resend_email' in request.POST):
# Perform update member_enabled flag.
operation = v_members.resend_email(
request.session['member_cred'], request.POST['resend_email'])
# Set context dictionary with the result of enable operation.
context.update(operation)
# Perform the search.
operation = Member().retrieve_member(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment