from flask import Blueprint, request from ..schemas import model from .. import impl from ..services.auth_guard import auth_guard import json import logging bp = Blueprint('user', __name__) @bp.route('/user', methods=['put']) @auth_guard() # no restriction by role def PutUser(): try: content = request.get_json(force=True) loadedModel = model.UserSchema().load(data=content, many=False, partial=True) except Exception as ex: logging.error(ex) print(ex) return json.dumps("bad format"), 400 return impl.user.PutUser(loadedModel)