changeset 5198:93e055489e68

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.
author Mads Kiilerich <madski@unity3d.com>
date Fri, 19 Jun 2015 18:06:39 +0200
parents f32c68450266
children cb3fa867418f
files kallithea/model/comment.py kallithea/model/pull_request.py
diffstat 2 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/model/comment.py	Fri Jun 19 18:06:24 2015 +0200
+++ b/kallithea/model/comment.py	Fri Jun 19 18:06:39 2015 +0200
@@ -170,7 +170,7 @@
         """
         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)
--- a/kallithea/model/pull_request.py	Fri Jun 19 18:06:24 2015 +0200
+++ b/kallithea/model/pull_request.py	Fri Jun 19 18:06:39 2015 +0200
@@ -98,7 +98,8 @@
             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,