aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrr-2016-06-12 14:12:00 +0200
committerrr-2016-06-12 14:24:14 +0200
commit40565e82ae2ab3eb15d0d8f1dd08008a6f6c71bf (patch)
tree80b3a76dc0f7af4d2ad63cd1a567d57d10a8cfc8
parentb1b261beb85ba337658c401b7c186a3577a0a61c (diff)
server/posts: change comment-time behavior
Rather than looking at the edit time, now it looks at the creation time.
-rw-r--r--server/szurubooru/search/configs/post_search_config.py4
-rw-r--r--server/szurubooru/tests/search/configs/test_post_search_config.py6
2 files changed, 5 insertions, 5 deletions
diff --git a/server/szurubooru/search/configs/post_search_config.py b/server/szurubooru/search/configs/post_search_config.py
index 2cd381c..1039cf6 100644
--- a/server/szurubooru/search/configs/post_search_config.py
+++ b/server/szurubooru/search/configs/post_search_config.py
@@ -167,7 +167,7 @@ class PostSearchConfig(BaseSearchConfig):
('last-edit-date', 'last-edit-time', 'edit-date', 'edit-time'):
search_util.create_date_filter(db.Post.last_edit_time),
('comment-date', 'comment-time'):
- search_util.create_date_filter(db.Post.last_comment_edit_time),
+ search_util.create_date_filter(db.Post.last_comment_creation_time),
('fav-date', 'fav-time'):
search_util.create_date_filter(db.Post.last_favorite_time),
('feature-date', 'feature-time'):
@@ -196,7 +196,7 @@ class PostSearchConfig(BaseSearchConfig):
('last-edit-date', 'last-edit-time', 'edit-date', 'edit-time'):
(db.Post.last_edit_time, self.SORT_DESC),
('comment-date', 'comment-time'):
- (db.Post.last_comment_edit_time, self.SORT_DESC),
+ (db.Post.last_comment_creation_time, self.SORT_DESC),
('fav-date', 'fav-time'):
(db.Post.last_favorite_time, self.SORT_DESC),
('feature-date', 'feature-time'):
diff --git a/server/szurubooru/tests/search/configs/test_post_search_config.py b/server/szurubooru/tests/search/configs/test_post_search_config.py
index 035e770..55b24a8 100644
--- a/server/szurubooru/tests/search/configs/test_post_search_config.py
+++ b/server/szurubooru/tests/search/configs/test_post_search_config.py
@@ -420,9 +420,9 @@ def test_filter_by_comment_date(
comment1 = comment_factory(post=post1)
comment2 = comment_factory(post=post2)
comment3 = comment_factory(post=post3)
- comment1.last_edit_time = datetime.datetime(2014, 1, 1)
- comment2.last_edit_time = datetime.datetime(2015, 1, 1)
- comment3.last_edit_time = datetime.datetime(2016, 1, 1)
+ comment1.creation_time = datetime.datetime(2014, 1, 1)
+ comment2.creation_time = datetime.datetime(2015, 1, 1)
+ comment3.creation_time = datetime.datetime(2016, 1, 1)
db.session.add_all([post1, post2, post3, comment1, comment2, comment3])
verify_unpaged(input, expected_post_ids)

© 2015 - 2026 Jakob L. Kreuze