diff options
| author | Georgios Andreadis <info@gandreadis.com> | 2020-06-29 16:05:23 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2020-08-24 16:18:36 +0200 |
| commit | 4f9a40abdc7836345113c047f27fcc96800cb3f5 (patch) | |
| tree | e443d14e34a884b1a4d9c549f81d51202eddd5f7 /opendc/api/v2/users/endpoint.py | |
| parent | cd5f7bf3a72913e1602cb4c575e61ac7d5519be0 (diff) | |
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.
Diffstat (limited to 'opendc/api/v2/users/endpoint.py')
| -rw-r--r-- | opendc/api/v2/users/endpoint.py | 31 |
1 files changed, 0 insertions, 31 deletions
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) |
