fix: Add missing commas in function calls and improve code formatting
This commit is contained in:
@@ -460,7 +460,7 @@ async def update_profile(
|
||||
"""Update the current user's profile."""
|
||||
try:
|
||||
updated_user = await auth_service.update_user_profile(
|
||||
current_user, request.model_dump(exclude_unset=True)
|
||||
current_user, request.model_dump(exclude_unset=True),
|
||||
)
|
||||
return await auth_service.user_to_response(updated_user)
|
||||
except Exception as e:
|
||||
@@ -482,7 +482,7 @@ async def change_password(
|
||||
user_email = current_user.email
|
||||
try:
|
||||
await auth_service.change_user_password(
|
||||
current_user, request.current_password, request.new_password
|
||||
current_user, request.current_password, request.new_password,
|
||||
)
|
||||
return {"message": "Password changed successfully"}
|
||||
except ValueError as e:
|
||||
@@ -505,7 +505,7 @@ async def get_user_providers(
|
||||
) -> list[dict[str, str]]:
|
||||
"""Get the current user's connected authentication providers."""
|
||||
providers = []
|
||||
|
||||
|
||||
# Add password provider if user has password
|
||||
if current_user.password_hash:
|
||||
providers.append({
|
||||
@@ -513,7 +513,7 @@ async def get_user_providers(
|
||||
"display_name": "Password",
|
||||
"connected_at": current_user.created_at.isoformat(),
|
||||
})
|
||||
|
||||
|
||||
# Get OAuth providers from the database
|
||||
oauth_providers = await auth_service.get_user_oauth_providers(current_user)
|
||||
for oauth in oauth_providers:
|
||||
@@ -522,11 +522,11 @@ async def get_user_providers(
|
||||
display_name = "GitHub"
|
||||
elif oauth.provider == "google":
|
||||
display_name = "Google"
|
||||
|
||||
|
||||
providers.append({
|
||||
"provider": oauth.provider,
|
||||
"display_name": display_name,
|
||||
"connected_at": oauth.created_at.isoformat(),
|
||||
})
|
||||
|
||||
|
||||
return providers
|
||||
|
||||
@@ -41,5 +41,5 @@ async def get_top_sounds(
|
||||
return await dashboard_service.get_top_sounds(
|
||||
sound_type=sound_type,
|
||||
period=period,
|
||||
limit=limit
|
||||
limit=limit,
|
||||
)
|
||||
|
||||
@@ -8,6 +8,7 @@ from sqlmodel.ext.asyncio.session import AsyncSession
|
||||
from app.core.database import get_db
|
||||
from app.core.dependencies import get_current_active_user_flexible
|
||||
from app.models.user import User
|
||||
from app.repositories.playlist import PlaylistSortField, SortOrder
|
||||
from app.schemas.common import MessageResponse
|
||||
from app.schemas.playlist import (
|
||||
PlaylistAddSoundRequest,
|
||||
@@ -19,7 +20,6 @@ from app.schemas.playlist import (
|
||||
PlaylistUpdateRequest,
|
||||
)
|
||||
from app.services.playlist import PlaylistService
|
||||
from app.repositories.playlist import PlaylistSortField, SortOrder
|
||||
|
||||
router = APIRouter(prefix="/playlists", tags=["playlists"])
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ from app.core.dependencies import get_current_active_user_flexible
|
||||
from app.models.credit_action import CreditActionType
|
||||
from app.models.sound import Sound
|
||||
from app.models.user import User
|
||||
from app.repositories.sound import SoundRepository, SoundSortField, SortOrder
|
||||
from app.repositories.sound import SortOrder, SoundRepository, SoundSortField
|
||||
from app.services.credit import CreditService, InsufficientCreditsError
|
||||
from app.services.vlc_player import VLCPlayerService, get_vlc_player_service
|
||||
|
||||
|
||||
Reference in New Issue
Block a user