Merge "update StoriesController so users subsribe to stories they create"
This commit is contained in:
commit
6db2fe34cb
@ -38,6 +38,7 @@ from storyboard.api.v1 import wmodels
|
||||
from storyboard.common import decorators
|
||||
from storyboard.common import exception as exc
|
||||
from storyboard.db.api import stories as stories_api
|
||||
from storyboard.db.api import subscriptions as subscription_api
|
||||
from storyboard.db.api import timeline_events as events_api
|
||||
from storyboard.db.api import users as users_api
|
||||
|
||||
@ -236,6 +237,11 @@ class StoriesController(rest.RestController):
|
||||
if story.private:
|
||||
stories_api.create_permission(created_story, users, teams)
|
||||
|
||||
subscription_api.subscription_create({
|
||||
"target_type": "story",
|
||||
"target_id": created_story.id,
|
||||
"user_id": user_id
|
||||
})
|
||||
return wmodels.Story.from_db_model(created_story)
|
||||
|
||||
@decorators.db_exceptions
|
||||
|
Loading…
Reference in New Issue
Block a user