diff options
author | 2018-03-30 15:17:23 +0100 | |
---|---|---|
committer | 2018-03-30 15:17:23 +0100 | |
commit | 6a0436caf7d9ca9ce2c9fca9ecaf6dec8244e723 (patch) | |
tree | a4b2447358504b1111d687ded574507e03096801 /pysite | |
parent | Change to PyCharm imports (diff) |
Collect all roles from users instead of just a single one
Diffstat (limited to 'pysite')
-rw-r--r-- | pysite/views/api/bot/user.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/pysite/views/api/bot/user.py b/pysite/views/api/bot/user.py index 75757ade..a69af0fb 100644 --- a/pysite/views/api/bot/user.py +++ b/pysite/views/api/bot/user.py @@ -1,6 +1,7 @@ # coding=utf-8 +import logging -from flask import jsonify +from flask import jsonify, request from schema import Schema from pysite.base_route import APIView @@ -11,13 +12,13 @@ from pysite.mixins import DBMixin SCHEMA = Schema([ { "user_id": int, - "role": int + "roles": [int] } ]) REQUIRED_KEYS = [ "user_id", - "role" + "roles" ] @@ -30,6 +31,7 @@ class UserView(APIView, DBMixin): @api_key @api_params(schema=SCHEMA, validation_type=ValidationTypes.json) def post(self, data): + logging.getLogger(__name__).debug(f"Size of request: {len(request.data)} bytes") changes = self.db.insert( self.table_name, *data, conflict="update" |