Add imported tasks to master branch of relevant project
Change-Id: I65027746331e2ed44aecc4c8333825a00c4b9237
This commit is contained in:
parent
a7bbc0575f
commit
19b4ef8b0f
@ -22,6 +22,7 @@ from openid import cryptutil
|
|||||||
|
|
||||||
import storyboard.common.event_types as event_types
|
import storyboard.common.event_types as event_types
|
||||||
from storyboard.db.api import base as db_api
|
from storyboard.db.api import base as db_api
|
||||||
|
from storyboard.db.models import Branch
|
||||||
from storyboard.db.models import Comment
|
from storyboard.db.models import Comment
|
||||||
from storyboard.db.models import Project
|
from storyboard.db.models import Project
|
||||||
from storyboard.db.models import Story
|
from storyboard.db.models import Story
|
||||||
@ -54,6 +55,14 @@ class LaunchpadWriter(object):
|
|||||||
"it first." % (project_name)
|
"it first." % (project_name)
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
self.branch = db_api.model_query(Branch, self.session) \
|
||||||
|
.filter_by(project_id=self.project.id, name='master') \
|
||||||
|
.first()
|
||||||
|
if not self.branch:
|
||||||
|
print "No master branch found for project %s, please create " \
|
||||||
|
"one first." % (project_name)
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
def write_tags(self, bug):
|
def write_tags(self, bug):
|
||||||
"""Extracts the tags from a launchpad bug, seeds/loads them in the
|
"""Extracts the tags from a launchpad bug, seeds/loads them in the
|
||||||
StoryBoard database, and returns a list of the corresponding entities.
|
StoryBoard database, and returns a list of the corresponding entities.
|
||||||
@ -219,6 +228,7 @@ class LaunchpadWriter(object):
|
|||||||
'title': title,
|
'title': title,
|
||||||
'assignee_id': assignee.id if assignee else None,
|
'assignee_id': assignee.id if assignee else None,
|
||||||
'project_id': self.project.id,
|
'project_id': self.project.id,
|
||||||
|
'branch_id': self.branch.id,
|
||||||
'story_id': launchpad_id,
|
'story_id': launchpad_id,
|
||||||
'created_at': created_at,
|
'created_at': created_at,
|
||||||
'updated_at': updated_at,
|
'updated_at': updated_at,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user