Skip to content

Commit

Permalink
fix SpareCores/sc-www#133 descendirg order on a computed column
Browse files Browse the repository at this point in the history
  • Loading branch information
daroczig committed Oct 18, 2024
1 parent 796e07c commit cb7e64b
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/sc_keeper/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ def search_server_prices(
if OrderDir(order_dir) == OrderDir.ASC:
query = query.order_by(ServerExtra.score / ServerPrice.price)
else:
query = query.order_by(ServerExtra.score / ServerPrice.price).desc()
query = query.order_by(ServerExtra.score / ServerPrice.price * -1)
else:
order_obj = [
o
Expand Down Expand Up @@ -633,9 +633,7 @@ def search_server_prices(
if OrderDir(order_dir) == OrderDir.ASC:
query = query.order_by(ServerExtra.score / subquery_aliased.price)
else:
query = query.order_by(
ServerExtra.score / subquery_aliased.price
).desc()
query = query.order_by(ServerExtra.score / subquery_aliased.price * -1)
else:
order_obj = [
o
Expand Down

0 comments on commit cb7e64b

Please sign in to comment.