Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fibre
portal-interface
Commits
3792531a
Commit
3792531a
authored
Apr 20, 2020
by
marcosfelipp
Browse files
Resend e-mail to user to ativate account
parent
b73650b0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
6 deletions
+28
-6
portal/templates/mgmt/manage_members.html
portal/templates/mgmt/manage_members.html
+5
-6
portal/views/views_members.py
portal/views/views_members.py
+17
-0
portal/views/views_mgmt.py
portal/views/views_mgmt.py
+6
-0
No files found.
portal/templates/mgmt/manage_members.html
View file @
3792531a
...
...
@@ -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 %}
...
...
portal/views/views_members.py
View file @
3792531a
...
...
@@ -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
...
...
portal/views/views_mgmt.py
View file @
3792531a
...
...
@@ -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
(
...
...
Marcos Felipe Barboza
@marcosabreu
mentioned in issue
#104 (closed)
·
Apr 22, 2020
mentioned in issue
#104 (closed)
mentioned in issue #104
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment