fix password reset view

This commit is contained in:
wcolmenares 2019-05-01 17:48:24 -04:00
parent 55ca8688b9
commit 926b91ef97
2 changed files with 2 additions and 4 deletions

View file

@ -12,7 +12,7 @@
<div class="auth-center">
<div class="auth-content">
<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' %}
<form action="{% url 'reset' %}" method="post" class="form">
{% csrf_token %}

View file

@ -331,7 +331,7 @@ class ResetRequest(View):
# get the hidden value of user
user = request.POST.get("user")
# 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?' } )
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.' } )
@ -491,8 +491,6 @@ class PseudoUser():
class UserCreateAPI(APIView):
def post(self, request):
print(request.data)
print(request.POST)
username = request.POST.get('username')
email = request.POST.get('email')