fix broken query

pull/189/head
Aevann 2023-08-11 18:40:29 +03:00
parent 1461f11603
commit 3985254d9d
1 changed files with 1 additions and 1 deletions

View File

@ -29,7 +29,7 @@ def sort_objects(sort, objects, cls):
ti = int(time.time()) + 3600
metric = cls.realupvotes
if cls.__name__ == "Post": metric += cls.comment_count/5
return objects.order_by(-1000000*(metric + 1)/(func.power(((ti - cls.created_utc)/1000), 1.4)), cls.created_utc.desc())
return objects.order_by(-1000000*((metric + 1)/func.power(((ti - cls.created_utc)/1000), 1.4)), cls.created_utc.desc())
elif sort == "views" and cls.__name__ == "Post":
return objects.order_by(cls.views.desc(), cls.created_utc.desc())
elif sort == "bump" and cls.__name__ == "Post":