changeset 5278:1ae14a2ceba0

changeset: make code more stable against unexpected comments Avoid passing None to the template in comments. This makes the code more correct and fixes a crash seen while hacking, probably never seen in the wild.
author Mads Kiilerich <madski@unity3d.com>
date Mon, 20 Jul 2015 15:11:42 +0200
parents 39dfc5fc0ec2
children 346a56c690ff
files kallithea/controllers/changeset.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/controllers/changeset.py	Mon Jul 20 15:11:42 2015 +0200
+++ b/kallithea/controllers/changeset.py	Mon Jul 20 15:11:42 2015 +0200
@@ -241,7 +241,8 @@
                 comments.update((st.changeset_comment_id, st.comment)
                                 for st in ChangesetStatusModel()
                                 .get_statuses(c.db_repo.repo_id,
-                                              changeset.raw_id, with_revisions=True))
+                                              changeset.raw_id, with_revisions=True)
+                                if st.changeset_comment_id is not None)
 
                 inlines = ChangesetCommentsModel()\
                             .get_inline_comments(c.db_repo.repo_id,