[UPD] Add git.platform model
to manage connection with other Git softwares
This commit is contained in:
@@ -17,16 +17,20 @@ class CreateGitIssue(models.TransientModel):
|
||||
|
||||
def _create_git_issue(self):
|
||||
values = super(CreateGitIssue, self)._create_git_issue()
|
||||
github = Github(self.env.user.github_token)
|
||||
repo = github.get_repo(self.issue_repo.displayed_name)
|
||||
issue = repo.create_issue(title=self.issue_name, body=self.issue_description)
|
||||
values = {
|
||||
"name": issue.title,
|
||||
"repo": self.issue_repo.id,
|
||||
"status": self._convert_issue_status(issue.state),
|
||||
"url": issue.html_url,
|
||||
"task_id": self.env["project.task"]
|
||||
.browse(self._context.get("active_ids"))
|
||||
.id,
|
||||
}
|
||||
if self.issue_platform.tool == "github":
|
||||
github = Github(self.env.user.github_token)
|
||||
repo = github.get_repo(self.issue_repo.displayed_name)
|
||||
issue = repo.create_issue(
|
||||
title=self.issue_name, body=self.issue_description
|
||||
)
|
||||
values = {
|
||||
"name": issue.title,
|
||||
"platform": self.issue_platform.id,
|
||||
"repo": self.issue_repo.id,
|
||||
"status": self._convert_issue_status(issue.state),
|
||||
"url": issue.html_url,
|
||||
"task_id": self.env["project.task"]
|
||||
.browse(self._context.get("active_ids"))
|
||||
.id,
|
||||
}
|
||||
return values
|
||||
|
Reference in New Issue
Block a user