Skip to content

Commit df870d0

Browse files
committed
fix import style
1 parent bfbd082 commit df870d0

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

src/elections/crud.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,11 @@ async def update_election(db_session: AsyncSession, params: ElectionParameters)
6464
Does not validate if an election _already_ exists
6565
"""
6666

67-
election = (await db_session.execute(
67+
election = await db_session.scalar(
6868
sqlalchemy
6969
.select(Election)
70-
# TODO: what is filter_by?
71-
.filter_by(slug=params.slug)
72-
)).scalar_one()
70+
.where(slug=params.slug)
71+
)
7372

7473
if params.start_datetime is not None:
7574
election.start_datetime = params.start_datetime

src/elections/urls.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@
22
import re
33
from datetime import datetime
44

5-
from crud import ElectionParameters
65
from fastapi import APIRouter, HTTPException, Request, status
76
from fastapi.exceptions import RequestValidationError
8-
from tables import election_types
97

108
import auth
119
import auth.crud
1210
import database
1311
import elections
14-
from constants import root_ip_address
12+
from elections.crud import ElectionParameters
13+
from elections.tables import election_types
1514
from permission.types import ElectionOfficer
1615

1716
_logger = logging.getLogger(__name__)

src/main.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import elections.urls
1111
import officers.urls
1212
import permission.urls
13-
import tests.urls
1413

1514
logging.basicConfig(level=logging.DEBUG)
1615
database.setup_database()

0 commit comments

Comments
 (0)