def save(): uid = g.user.id mail = Mail.get(uid) if not mail: mail = Mail() data = request.json data['uid'] = uid mail.set_attrs(data) mail.save() return Success()
def get(): uid = g.user.id mail = Mail.get(uid) return jsonify(mail), 200
def save(): uid = g.user.id mail = Mail.get(uid) if not mail: mail = Mail() data = request.json data['uid'] = uid mail.set_attrs(data) mail.save() return Success()
def get(): uid = g.user.id mail = Mail.get(uid) return jsonify(mail), 200