From d0aaf8fa8f6e92f82ecc88e1f235304586db8fab Mon Sep 17 00:00:00 2001 From: rr- Date: Mon, 13 Jun 2016 23:57:16 +0200 Subject: [PATCH] server/posts: optimize default sort order --- server/szurubooru/search/configs/post_search_config.py | 2 +- server/szurubooru/tests/api/test_post_retrieving.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/szurubooru/search/configs/post_search_config.py b/server/szurubooru/search/configs/post_search_config.py index 686df4ff..4fca489f 100644 --- a/server/szurubooru/search/configs/post_search_config.py +++ b/server/szurubooru/search/configs/post_search_config.py @@ -106,7 +106,7 @@ class PostSearchConfig(BaseSearchConfig): return db.session.query(db.Post) def finalize_query(self, query): - return query.order_by(db.Post.creation_time.desc()) + return query.order_by(db.Post.post_id.desc()) @property def id_column(self): diff --git a/server/szurubooru/tests/api/test_post_retrieving.py b/server/szurubooru/tests/api/test_post_retrieving.py index 5b1c38c8..1474e622 100644 --- a/server/szurubooru/tests/api/test_post_retrieving.py +++ b/server/szurubooru/tests/api/test_post_retrieving.py @@ -35,7 +35,7 @@ def test_retrieving_multiple(test_ctx): assert result['page'] == 1 assert result['pageSize'] == 100 assert result['total'] == 2 - assert [t['id'] for t in result['results']] == [1, 2] + assert [t['id'] for t in result['results']] == [2, 1] def test_using_special_tokens( test_ctx, config_injector):