#3666 Make the most recent flags appear at the top
Merged 5 years ago by pingou. Opened 5 years ago by pingou.

file modified
+5 -1
@@ -2234,7 +2234,11 @@ 

  

      pull_request = relation(

          "PullRequest",

-         backref=backref("flags", cascade="delete, delete-orphan"),

+         backref=backref(

+             "flags",

+             order_by=str("(pull_request_flags.c.date_created).desc()"),

+             cascade="delete, delete-orphan"

+         ),

          foreign_keys=[pull_request_uid],

          remote_side=[PullRequest.uid],

      )

By inverting the order in which pull_request.flags returns the flags and
ensure this order is based on the date_created, we ensure that the most
recently added flags appear at the top when showing them on PRs, rather
than having them order by update date/time.

Fixes https://pagure.io/pagure/issue/3656

Signed-off-by: Pierre-Yves Chibon pingou@pingoured.fr

rebased onto f10b6f4

5 years ago

Pull-Request has been merged by pingou

5 years ago