comments: renamed ChangesetCommentsModel to CommentsModel to reflect what it actually does.
It's not limited to Changesets/Commits.
This commit is contained in:
parent
828c060bdd
commit
b52808ca95
14 changed files with 53 additions and 53 deletions
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
import pytest
|
||||
|
||||
from rhodecode.model.comment import ChangesetCommentsModel
|
||||
from rhodecode.model.comment import CommentsModel
|
||||
from rhodecode.model.db import UserLog
|
||||
from rhodecode.model.pull_request import PullRequestModel
|
||||
from rhodecode.tests import TEST_USER_ADMIN_LOGIN
|
||||
|
|
@ -52,7 +52,7 @@ class TestCommentPullRequest(object):
|
|||
response = api_call(self.app, params)
|
||||
pull_request = PullRequestModel().get(pull_request.pull_request_id)
|
||||
|
||||
comments = ChangesetCommentsModel().get_comments(
|
||||
comments = CommentsModel().get_comments(
|
||||
pull_request.target_repo.repo_id, pull_request=pull_request)
|
||||
|
||||
expected = {
|
||||
|
|
@ -83,7 +83,7 @@ class TestCommentPullRequest(object):
|
|||
response = api_call(self.app, params)
|
||||
pull_request = PullRequestModel().get(pull_request_id)
|
||||
|
||||
comments = ChangesetCommentsModel().get_comments(
|
||||
comments = CommentsModel().get_comments(
|
||||
pull_request.target_repo.repo_id, pull_request=pull_request)
|
||||
expected = {
|
||||
'pull_request_id': pull_request.pull_request_id,
|
||||
|
|
@ -132,7 +132,7 @@ class TestCommentPullRequest(object):
|
|||
response = api_call(self.app, params)
|
||||
pull_request = PullRequestModel().get(pull_request_id)
|
||||
|
||||
comments = ChangesetCommentsModel().get_comments(
|
||||
comments = CommentsModel().get_comments(
|
||||
pull_request.target_repo.repo_id, pull_request=pull_request)
|
||||
expected = {
|
||||
'pull_request_id': pull_request.pull_request_id,
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ from rhodecode.lib.auth import (HasRepoPermissionAnyApi)
|
|||
from rhodecode.lib.base import vcs_operation_context
|
||||
from rhodecode.lib.utils2 import str2bool
|
||||
from rhodecode.model.changeset_status import ChangesetStatusModel
|
||||
from rhodecode.model.comment import ChangesetCommentsModel
|
||||
from rhodecode.model.comment import CommentsModel
|
||||
from rhodecode.model.db import Session, ChangesetStatus
|
||||
from rhodecode.model.pull_request import PullRequestModel
|
||||
from rhodecode.model.settings import SettingsModel
|
||||
|
|
@ -455,7 +455,7 @@ def comment_pull_request(request, apiuser, repoid, pullrequestid,
|
|||
renderer = rc_config.get('rhodecode_markup_renderer', 'rst')
|
||||
|
||||
status_change = status and allowed_to_change_status
|
||||
comment = ChangesetCommentsModel().create(
|
||||
comment = CommentsModel().create(
|
||||
text=text,
|
||||
repo=pull_request.target_repo.repo_id,
|
||||
user=apiuser.user_id,
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ from rhodecode.lib.exceptions import StatusChangeOnClosedPullRequestError
|
|||
from rhodecode.lib.utils2 import str2bool, time_to_datetime
|
||||
from rhodecode.lib.ext_json import json
|
||||
from rhodecode.model.changeset_status import ChangesetStatusModel
|
||||
from rhodecode.model.comment import ChangesetCommentsModel
|
||||
from rhodecode.model.comment import CommentsModel
|
||||
from rhodecode.model.db import (
|
||||
Session, ChangesetStatus, RepositoryField, Repository, RepoGroup)
|
||||
from rhodecode.model.repo import RepoModel
|
||||
|
|
@ -1436,7 +1436,7 @@ def comment_commit(
|
|||
rc_config = SettingsModel().get_all_settings()
|
||||
renderer = rc_config.get('rhodecode_markup_renderer', 'rst')
|
||||
status_change_label = ChangesetStatus.get_status_lbl(status)
|
||||
comm = ChangesetCommentsModel().create(
|
||||
comm = CommentsModel().create(
|
||||
message, repo, user, commit_id=commit_id,
|
||||
status_change=status_change_label,
|
||||
status_change_type=status,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue