Skip to content

Commit f87455c

Browse files
committed
implement ai fix suggestions
1 parent b41daff commit f87455c

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

backend/python/app/dependencies/auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def check_email(access_token: str = Depends(get_access_token)) -> bool:
128128

129129

130130
# Common authorization dependencies
131-
require_driver = require_authorization_by_role({"Driver"})
131+
require_driver = require_authorization_by_role({"driver"})
132132

133133

134134
def get_current_user_id(access_token: str = Depends(get_access_token)) -> str:

backend/python/app/services/implementations/auth_service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def send_email_verification_link(self, email: str) -> None:
153153
raise e
154154

155155
async def is_authorized_by_role(
156-
self, _session: AsyncSession, access_token: str, _roles: set[str]
156+
self, _session: AsyncSession, access_token: str, roles: set[str]
157157
) -> bool:
158158
try:
159159
decoded_id_token = firebase_admin.auth.verify_id_token(
@@ -166,7 +166,7 @@ async def is_authorized_by_role(
166166
)
167167
return False
168168
# Allow if role is in the authorized set
169-
return user_role in _roles
169+
return user_role in roles
170170
except Exception as e:
171171
self.logger.error(f"Authorization failed: {type(e).__name__}: {e!s}")
172172
return False

backend/python/migrations/versions/01f342ea9ad6_add_cascade_delete_to_driver_and_admin.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
77
"""
88
from alembic import op
9-
import sqlalchemy as sa
10-
from sqlalchemy.dialects import postgresql
119

1210
# revision identifiers, used by Alembic.
1311
revision = '01f342ea9ad6'

0 commit comments

Comments
 (0)