Esempio n. 1
0
def user(request):
    content, code = get_or_create_user(UserService().get_user())

    user_response = HttpResponse(content)
    user_response.status_code = code

    return user_response
Esempio n. 2
0
def accept_dataset(request, token):
    email_access = DatasetEmailAccess.get_email_access_for_token(token)

    get_or_create_user(request.user.username)

    accounts = email_access.dataset.get_server_access()

    existing_account = False
    for login in accounts['authorized_viewers']:
        if login == request.user.username:
            existing_account = True

    if not existing_account:
        accounts['authorized_viewers'].append(request.user.username)
        email_access.dataset.set_server_access(accounts)

    return redirect(email_access.dataset.get_url())
Esempio n. 3
0
def user(request):

    content, code = get_or_create_user(request.user.username)

    user = request.user
    user_response = HttpResponse(content)
    user_response.status_code = code

    return user_response