def delete(self, user_id_to): '''取消关注''' user_id = authutil.get_user_id(g.ukey) try: backend.unfollow_user(user_id, user_id_to) except BackendError, ex: raise
def delete(self,user_id_to): '''取消关注''' user_id = authutil.get_user_id(g.ukey) try: backend.unfollow_user(user_id,user_id_to) except BackendError,ex: raise
def delete(self,post_id): post = backend.get_post(post_id) curr_id = authutil.get_user_id(g.ukey) if post['author_id'] != curr_id: return jsonify(error='forbid') try: backend.set_post(post_id,{'show':'deleted_by_user'}) except BackendError,ex: abort(501)
def delete(self, post_id): post = backend.get_post(post_id) curr_id = authutil.get_user_id(g.ukey) if post["author_id"] != curr_id: return jsonify(error="forbid") try: backend.set_post(post_id, {"show": "deleted_by_user"}) except BackendError, ex: abort(501)
def post(self): '''关注用户''' data = UserFollowSchema().deserialize(request.json) from_id = authutil.get_user_id(g.ukey) for uid in data['user_ids']: try: backend.follow_user(from_id, uid) backend.add_activity({ 'from_id': from_id, 'to_id': uid, 'atype': 'follow' }) except BackendError, ex: pass
def post(self): '''关注用户''' data = UserFollowSchema().deserialize(request.json) from_id = authutil.get_user_id(g.ukey) for uid in data['user_ids']: try: backend.follow_user(from_id,uid) backend.add_activity({ 'from_id':from_id, 'to_id':uid, 'atype':'follow' }) except BackendError,ex: pass
def get(self, user_id_to): user_id = authutil.get_user_id(g.ukey) ret = backend.is_following_user(user_id, user_id_to) return jsonify(is_follow=ret)
def get(self,user_id_to): user_id = authutil.get_user_id(g.ukey) ret = backend.is_following_user(user_id,user_id_to) return jsonify(is_follow=ret)