def post(self):
form = ProfileCoverSetForm(self.request.arguments)
if not form.validate():
raise HTTPError(404)
profile_cover_id = form.profile_cover_id.data
profile_cover = yield OfficialProfileCoverDocument.find_one({
'_id': ObjectId(profile_cover_id)
})
if not profile_cover:
raise HTTPError(404)
cover = DBRef(
OfficialProfileCoverDocument.meta['collection'],
ObjectId(profile_cover['_id'])
)
yield UserSettingDocument.set_profile_cover(
self.current_user['_id'], cover
)
raise gen.Return()
评论列表
文章目录