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