forked from admin/miem_workers
feat: add council employee sorting by name and publication counts
This commit is contained in:
1 parent
fac0431a03
commit
32e26ccdd2
9 files changed
+105
-20
No files matched your search
+3
-2
@@ -134,9 +134,10 @@ def directory(
|
||||
|
||||
|
||||
@router.get("/council", response_class=HTMLResponse)
|
||||
def council(request: Request, q: str = "", offset: int = 0, db: Session = Depends(get_db)):
|
||||
def council(request: Request, q: str = "", offset: int = 0, sort: str = "csv_count", direction: str = "desc",
|
||||
db: Session = Depends(get_db)):
|
||||
try:
|
||||
result = council_candidates(db, q=q, offset=offset)
|
||||
result = council_candidates(db, q=q, offset=offset, sort=sort, direction=direction)
|
||||
except (SQLAlchemyError, OSError, ValueError, KeyError):
|
||||
db.rollback()
|
||||
return _render(request, "council.html", {"error": True, "public_page": True}, status_code=503)
|
||||
|
||||
Reference in new issue
Block a user