myblt.py 文件源码

python
阅读 16 收藏 0 点赞 0 评论 0

项目:maro.xyz-website 作者: Kiniamaro 项目源码 文件源码
def register():
    req = request.get_json()
    if 'username' not in req or 'password' not in req \
       or 'invite_code' not in req:
        return jsonify({'error': 'Bad request'}), 400

    username = req['username']
    password = req['password']
    invite_code = req['invite_code']

    if not verify_invite_code(invite_code):
        return jsonify({'error': 'Invalid invite code'}), 400

    new_user(username, password)
    Invite.query.filter(Invite.code == invite_code).first().redeemed = True
    db_session.commit()
    return jsonify({'success': True})
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号