summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-api/opendc/api/v2/users/endpoint.py
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-10-25 14:53:54 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2021-10-25 14:53:54 +0200
commitaa9b32f8cd1467e9718959f400f6777e5d71737d (patch)
treeb88bbede15108c6855d7f94ded4c7054df186a72 /opendc-web/opendc-web-api/opendc/api/v2/users/endpoint.py
parenteb0e0a3bc557c05a70eead388797ab850ea87366 (diff)
parentb7a71e5b4aa77b41ef41deec2ace42b67a5a13a7 (diff)
merge: Integrate v2.1 progress into public repository
This pull request integrates the changes planned for the v2.1 release of OpenDC into the public Github repository in order to sync the progress of both repositories.
Diffstat (limited to 'opendc-web/opendc-web-api/opendc/api/v2/users/endpoint.py')
-rw-r--r--opendc-web/opendc-web-api/opendc/api/v2/users/endpoint.py30
1 files changed, 0 insertions, 30 deletions
diff --git a/opendc-web/opendc-web-api/opendc/api/v2/users/endpoint.py b/opendc-web/opendc-web-api/opendc/api/v2/users/endpoint.py
deleted file mode 100644
index 0dcf2463..00000000
--- a/opendc-web/opendc-web-api/opendc/api/v2/users/endpoint.py
+++ /dev/null
@@ -1,30 +0,0 @@
-from opendc.models.user import User
-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, '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, 'Successfully created user.', user.obj)