sort removed and deleted comments too (instead of older -> newer)

pull/200/head
Aevann 2023-09-07 23:08:10 +03:00
parent 5124a0d063
commit 3c26d4da80
1 changed files with 2 additions and 1 deletions

View File

@ -1,6 +1,7 @@
import time
from sqlalchemy.sql import func
from sqlalchemy.sql.sqltypes import *
from flask import g
from files.helpers.config.const import *
@ -30,7 +31,7 @@ def apply_time_filter(t, objects, cls):
def sort_objects(sort, objects, cls):
if sort == 'hot':
if not (SITE == 'watchpeopledie.tv' and g.v and g.v.id == GTIX_ID):
objects = objects.order_by(cls.is_banned, cls.deleted_utc)
objects = objects.order_by(func.cast(cls.is_banned, Boolean), func.cast(cls.deleted_utc, Boolean))
ti = int(time.time()) + 3600
metric = cls.realupvotes + 1