session-close-fix
This commit is contained in:
@@ -73,8 +73,8 @@ async def follow(_, info, what, slug):
|
||||
_topic_dict = await cache_by_slug(what, slug)
|
||||
|
||||
elif what == "COMMUNITY":
|
||||
# FIXME: when more communities
|
||||
follows = local_session().execute(select(Community))
|
||||
with local_session() as session:
|
||||
follows = session.execute(select(Community))
|
||||
|
||||
elif what == "SHOUT":
|
||||
error = reactions_follow(follower_id, slug)
|
||||
@@ -122,7 +122,8 @@ async def unfollow(_, info, what, slug):
|
||||
_topic_dict = await cache_by_slug(what, slug)
|
||||
|
||||
elif what == "COMMUNITY":
|
||||
follows = local_session().execute(select(Community))
|
||||
with local_session() as session:
|
||||
follows = session.execute(select(Community))
|
||||
|
||||
elif what == "SHOUT":
|
||||
error = reactions_unfollow(follower_id, slug)
|
||||
|
Reference in New Issue
Block a user