Fix bug: check the posted username also with logged in user's

username
This commit is contained in:
PCoder 2019-02-23 18:45:53 +01:00
parent 113fa2c454
commit 6a28b51354

View file

@ -333,7 +333,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: if user == "" or not user or user != self.request.user.username:
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.' } )