# HG changeset patch # User Mads Kiilerich # Date 2015-06-19 18:06:39 # Node ID 93e055489e68d40bb2948cc3394ee65833dcadf0 # Parent f32c68450266ce81dc9a5c70107aa53d6054858a pullrequsts: really create a comment when creating a PR and setting status to 'under review' 14d75d4b03cd changed the pullrequest creation status change comment text from redundant blurb to just an empty string. Empty comments are however only created if changing the status ... and in this case we didn't tell the comment creator that it actually was a status change. As a result of this, we ended up breaking the implicit invariant that all status updates have a comment. That showed up as errors dereferencing None when displaying changesets. diff --git a/kallithea/model/comment.py b/kallithea/model/comment.py --- a/kallithea/model/comment.py +++ b/kallithea/model/comment.py @@ -170,7 +170,7 @@ class ChangesetCommentsModel(BaseModel): """ if not status_change and not text: log.warning('Missing text for comment, skipping...') - return + return None repo = self._get_repo(repo) user = self._get_user(user) diff --git a/kallithea/model/pull_request.py b/kallithea/model/pull_request.py --- a/kallithea/model/pull_request.py +++ b/kallithea/model/pull_request.py @@ -98,7 +98,8 @@ class PullRequestModel(BaseModel): repo=org_repo, user=new.author, pull_request=new, - send_email=False + send_email=False, + status_change=ChangesetStatus.STATUS_UNDER_REVIEW, ) ChangesetStatusModel().set_status( org_repo,