return-error-on-follow

This commit is contained in:
2024-03-11 16:52:16 +03:00
parent ebf08ea2ed
commit e6f5cfcb8d
2 changed files with 70 additions and 69 deletions

View File

@@ -96,10 +96,10 @@ def topic_follow(follower_id, slug):
with local_session() as session:
topic = session.query(Topic).where(Topic.slug == slug).one()
_following = TopicFollower(topic=topic.id, follower=follower_id)
return True
return None
except Exception as exc:
logger.error(exc)
return False
return exc
def topic_unfollow(follower_id, slug):
@@ -114,10 +114,10 @@ def topic_unfollow(follower_id, slug):
if sub:
session.delete(sub)
session.commit()
return True
return None
except Exception as ex:
logger.debug(ex)
return False
return ex
@query.field('get_topics_random')