From 4f9a40abdc7836345113c047f27fcc96800cb3f5 Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Mon, 29 Jun 2020 16:05:23 +0200 Subject: Prepare web-server repository for monorepo This change prepares the web-server Git repository for the monorepo residing at https://github.com/atlarge-research.com/opendc. To accomodate for this, we move all files into a web-server subdirectory. --- opendc/api/v2/users/endpoint.py | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 opendc/api/v2/users/endpoint.py (limited to 'opendc/api/v2/users/endpoint.py') diff --git a/opendc/api/v2/users/endpoint.py b/opendc/api/v2/users/endpoint.py deleted file mode 100644 index c6041756..00000000 --- a/opendc/api/v2/users/endpoint.py +++ /dev/null @@ -1,31 +0,0 @@ -from opendc.models.user import User -from opendc.util import exceptions -from opendc.util.database import DB -from opendc.util.rest import Response - - -def GET(request): - """Search for a User using their email address.""" - - request.check_required_parameters(query={'email': 'string'}) - - user = User.from_email(request.params_query['email']) - - user.check_exists() - - return Response(200, f'Successfully retrieved user.', user.obj) - - -def POST(request): - """Add a new User.""" - - request.check_required_parameters(body={'user': {'email': 'string'}}) - - user = User(request.params_body['user']) - user.set_property('googleId', request.google_id) - user.set_property('authorizations', []) - - user.check_already_exists() - - user.insert() - return Response(200, f'Successfully created user.', user.obj) -- cgit v1.2.3