Download OneApi/api/exists.py from dragxd/oneapi: direct link, hf CLI and curl.
- Browser
- Download file 604 Bytes
-
https://huggingface.co/spaces/dragxd/oneapi/resolve/main/OneApi/api/exists.py
- Command line
-
hf download hf://spaces/dragxd/oneapi/OneApi/api/exists.py
-
curl -L -o exists.py https://huggingface.co/spaces/dragxd/oneapi/resolve/main/OneApi/api/exists.py
604 Bytes
| from ..database import * | |
| from quart import * | |
| from .. import * | |
| import logging | |
| user = user() | |
| exists_bp = Blueprint('exists', __name__) | |
| async def exists(): | |
| data = await request.get_json() | |
| if not data or not 'user_id' in data: return jsonify({'error': 'missing user_id'}), 400 | |
| user_id = int(data.get('user_id')) | |
| d = await user.find(user_id, check=True) | |
| if d: return jsonify({'message': 'user exists'}), 200 | |
| elif not d: return jsonify({'message': "user not found"}), 404 | |
| elif 'Error' in d: return jsonify({'error': d}), 400 | |
| else: logging.info(d) | |