示例#1
0
def login(request):
    """
    Retrieve package's infos from the package id
    to be able to later retrieve the authentication token
    given that we do not store any emails/persons ids.
    """
    resource = LoginResource()
    form = GetEmailAddressesForm(request.DATA)
    if not form.is_valid():
        return resource.form_errors(form)

    try:
        address = resource.client('GetEmailAddresses', form.cleaned_data)
    except BangoError, exc:
        return resource.client_errors(exc)