| |
@@ -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