autosubscribe when shout created
This commit is contained in:
parent
dc3f7fe6a5
commit
8b2bbfec7b
|
@ -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
|
||||||
|
@ -19,7 +20,9 @@ async def create_shout(_, info, input):
|
||||||
ShoutAuthor.create(
|
ShoutAuthor.create(
|
||||||
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"])
|
||||||
|
|
||||||
|
@ -106,4 +109,4 @@ async def delete_shout(_, info, slug):
|
||||||
shout.deletedAt = datetime.now()
|
shout.deletedAt = datetime.now()
|
||||||
session.commit()
|
session.commit()
|
||||||
|
|
||||||
return {}
|
return {}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user