#import pprint
from django.http import HttpResponse
# from django.template import Context, loader
from django.shortcuts import render, get_object_or_404
#from django.http import Http404
from coin.members.models import Member


def index(request):
    return HttpResponse("Hello, world. You're at the members index.")


def change_password(request, member_id):
    member = get_object_or_404(Member, pk=member_id)
    if request.POST['password']:
        member.password = ''
    else:
        return render(request, 'members/change_password.html',
                      {'member': member})
