fix password reset view
This commit is contained in:
parent
55ca8688b9
commit
926b91ef97
2 changed files with 2 additions and 4 deletions
|
@ -12,7 +12,7 @@
|
||||||
<div class="auth-center">
|
<div class="auth-center">
|
||||||
<div class="auth-content">
|
<div class="auth-content">
|
||||||
<div class="auth-box">
|
<div class="auth-box">
|
||||||
<h1 class="section-heading allcaps">{% trans "Please set new password for {{user}} " %}</h1>
|
<h1 class="section-heading allcaps">{% trans "Please set new password for " %} {{user}} </h1>
|
||||||
{% include 'includes/_messages.html' %}
|
{% include 'includes/_messages.html' %}
|
||||||
<form action="{% url 'reset' %}" method="post" class="form">
|
<form action="{% url 'reset' %}" method="post" class="form">
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
|
|
|
@ -331,7 +331,7 @@ class ResetRequest(View):
|
||||||
# get the hidden value of user
|
# get the hidden value of user
|
||||||
user = request.POST.get("user")
|
user = request.POST.get("user")
|
||||||
# some checks over the supplied data
|
# some checks over the supplied data
|
||||||
if user == "" or not user or user != self.request.user.username:
|
if user == "" or not user:
|
||||||
return render(request, 'error.html', { 'service': service, 'error': 'Something went wrong. Did you use the supplied form?' } )
|
return render(request, 'error.html', { 'service': service, 'error': 'Something went wrong. Did you use the supplied form?' } )
|
||||||
if password1 == "" or not password1 or password2 == "" or not password2:
|
if password1 == "" or not password1 or password2 == "" or not password2:
|
||||||
return render(request, 'error.html', { 'service': service, 'error': 'Please supply a password and confirm it.' } )
|
return render(request, 'error.html', { 'service': service, 'error': 'Please supply a password and confirm it.' } )
|
||||||
|
@ -491,8 +491,6 @@ class PseudoUser():
|
||||||
class UserCreateAPI(APIView):
|
class UserCreateAPI(APIView):
|
||||||
|
|
||||||
def post(self, request):
|
def post(self, request):
|
||||||
print(request.data)
|
|
||||||
print(request.POST)
|
|
||||||
|
|
||||||
username = request.POST.get('username')
|
username = request.POST.get('username')
|
||||||
email = request.POST.get('email')
|
email = request.POST.get('email')
|
||||||
|
|
Loading…
Reference in a new issue