autosubscribe when shout created
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
from orm import Shout, ShoutRating, ShoutRatingStorage
|
from orm import Shout, ShoutRating, ShoutRatingStorage
|
||||||
from orm.base import local_session
|
from orm.base import local_session
|
||||||
from resolvers.base import mutation, query, subscription
|
from resolvers.base import mutation, query, subscription
|
||||||
|
from resolvers.comments import comments_subscribe
|
||||||
from auth.authenticate import login_required
|
from auth.authenticate import login_required
|
||||||
import asyncio
|
import asyncio
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
@@ -20,6 +21,8 @@ async def create_shout(_, info, input):
|
|||||||
shout = new_shout.slug,
|
shout = new_shout.slug,
|
||||||
user = user.slug)
|
user = user.slug)
|
||||||
|
|
||||||
|
comments_subscribe(user, new_shout.slug, True)
|
||||||
|
|
||||||
if "mainTopic" in input:
|
if "mainTopic" in input:
|
||||||
topic_slugs.append(input["mainTopic"])
|
topic_slugs.append(input["mainTopic"])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user