def reset_password(request, reset_id):
    error = None
    if request.method == 'POST' and 'password' in request.POST and request.POST['password']:
        try:
            p = PasswordResetRequest.objects.get(uid = reset_id)
            u = p.user
            u.password = hash_password(request.POST['password'].strip())
            u.save()

            #perform for all that login magic that happens under the covers
            user = attempt_login(request, u.username, request.POST['password'].strip())
            p.delete()
            return set_auth_cookies(HttpResponseRedirect('/'), user)
        except Exception:
            logging.exception("Error In Reset Password")
            error = 'There was an error resetting your password.'

    return render(request, 'user/reset_password.html', {
        'error' : error,
        'reset_token' : reset_id,
    })
dataset/ETHPy150Open jumoconnect/openjumo/jumodjango/users/views.py/reset_password/original