fix double prepend

This commit is contained in:
2022-11-26 02:35:26 +03:00
parent 152c3362a0
commit dec9efc49b
2 changed files with 14 additions and 11 deletions

View File

@@ -98,11 +98,12 @@ async def topic_follow(user, slug):
async def topic_unfollow(user, slug):
with local_session() as session:
sub = (
session.query(TopicFollower)
.filter(
and_(TopicFollower.follower == user.slug, TopicFollower.topic == slug)
)
.first()
session.query(TopicFollower).filter(
and_(
TopicFollower.follower == user.slug,
TopicFollower.topic == slug
)
).first()
)
if not sub:
raise Exception("[resolvers.topics] follower not exist")