Skip to content

Commit

Permalink
Merge pull request #1241 from bcgov/fix/daniel-add-fs-sorting-1213
Browse files Browse the repository at this point in the history
fix: Add sorting back to Fuel Supply
  • Loading branch information
dhaselhan authored Nov 18, 2024
2 parents 1d55107 + b340074 commit b184da9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions backend/lcfs/web/api/fuel_supply/repo.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import structlog
from typing import List, Optional
from typing import List, Optional, Sequence
from fastapi import Depends
from sqlalchemy import and_, delete, or_, select, case
from sqlalchemy import func
Expand Down Expand Up @@ -360,7 +360,7 @@ async def get_latest_fuel_supply_by_group_uuid(
@repo_handler
async def get_effective_fuel_supplies(
self, compliance_report_group_uuid: str
) -> List[FuelSupply]:
) -> Sequence[FuelSupply]:
"""
Retrieve effective FuelSupply records associated with the given compliance_report_group_uuid.
For each group_uuid:
Expand Down Expand Up @@ -436,6 +436,7 @@ async def get_effective_fuel_supplies(
user_type_priority == valid_fuel_supplies_subq.c.max_role_priority,
),
)
.order_by(FuelSupply.create_date.asc())
)

# Step 5: Execute the query and retrieve results using unique()
Expand Down

0 comments on commit b184da9

Please sign in to comment.