# HG changeset patch # User Mads Kiilerich # Date 2016-03-14 16:17:46 # Node ID 0c29e737db23e1d975e856592b7817c60ce86fa1 # Parent 272cb88d97c29f755421607b38fc8e04db799924 pullrequests: explicitly sort statuses and comments by id - and thus presumably in the right order used for computation of latest status diff --git a/kallithea/model/db.py b/kallithea/model/db.py --- a/kallithea/model/db.py +++ b/kallithea/model/db.py @@ -2317,8 +2317,8 @@ class PullRequest(Base, BaseModel): cascade="all, delete-orphan") org_repo = relationship('Repository', primaryjoin='PullRequest.org_repo_id==Repository.repo_id') other_repo = relationship('Repository', primaryjoin='PullRequest.other_repo_id==Repository.repo_id') - statuses = relationship('ChangesetStatus') - comments = relationship('ChangesetComment', + statuses = relationship('ChangesetStatus', order_by='ChangesetStatus.changeset_status_id') + comments = relationship('ChangesetComment', order_by='ChangesetComment.comment_id', cascade="all, delete-orphan") def is_closed(self):