def post(self, name):
if not current_user.is_authenticated:
return abort(401, message='permission denied')
for topic in current_user.following_topics:
if topic.name == name:
return topic
topic = topics_service.get(name)
if topic is None:
return abort(400, message='topic not found')
try:
current_user.following_topics.append(topic)
topic.followers_count += 1
print topic.followers_count
db.session.commit()
except:
db.session.rollback()
return abort(500, message='operation failed')
return topic
评论列表
文章目录