Merge branch 'william' into 'master'

fix password reset view

See merge request ungleich-public/ungleich-user!3
This commit is contained in:
pcoder116 2019-05-02 00:14:55 +02:00
commit d0cb515cd9
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')