import json


def retrieve_password_email(request):
    """ Helper function to unpack the username and the password from the
    request
    Raises an exception if the request wasn't made via POST
    """
    info = json.loads(request.POST.get('user'))
    email = info['email']
    password = info['password']
    return password, email