chore(backend): standardize multiline formatting across modules
Reformatted multiline function calls, object definitions, and queries for improved code readability and consistency. Adjusted imports and constraints where necessary.
This commit is contained in:
@@ -197,10 +197,10 @@ async def list_projects(
|
||||
status_filter: ProjectStatus | None = Query(
|
||||
None, alias="status", description="Filter by project status"
|
||||
),
|
||||
search: str | None = Query(None, description="Search by name, slug, or description"),
|
||||
all_projects: bool = Query(
|
||||
False, description="Show all projects (superuser only)"
|
||||
search: str | None = Query(
|
||||
None, description="Search by name, slug, or description"
|
||||
),
|
||||
all_projects: bool = Query(False, description="Show all projects (superuser only)"),
|
||||
current_user: User = Depends(get_current_user),
|
||||
db: AsyncSession = Depends(get_db),
|
||||
) -> Any:
|
||||
@@ -212,7 +212,9 @@ async def list_projects(
|
||||
"""
|
||||
try:
|
||||
# Determine owner filter based on user role and request
|
||||
owner_id = None if (current_user.is_superuser and all_projects) else current_user.id
|
||||
owner_id = (
|
||||
None if (current_user.is_superuser and all_projects) else current_user.id
|
||||
)
|
||||
|
||||
projects_data, total = await project_crud.get_multi_with_counts(
|
||||
db,
|
||||
@@ -379,13 +381,15 @@ async def update_project(
|
||||
_check_project_ownership(project, current_user)
|
||||
|
||||
# Update the project
|
||||
updated_project = await project_crud.update(db, db_obj=project, obj_in=project_in)
|
||||
logger.info(
|
||||
f"User {current_user.email} updated project {updated_project.slug}"
|
||||
updated_project = await project_crud.update(
|
||||
db, db_obj=project, obj_in=project_in
|
||||
)
|
||||
logger.info(f"User {current_user.email} updated project {updated_project.slug}")
|
||||
|
||||
# Get updated project with counts
|
||||
project_data = await project_crud.get_with_counts(db, project_id=updated_project.id)
|
||||
project_data = await project_crud.get_with_counts(
|
||||
db, project_id=updated_project.id
|
||||
)
|
||||
|
||||
if not project_data:
|
||||
# This shouldn't happen, but handle gracefully
|
||||
@@ -551,7 +555,9 @@ async def pause_project(
|
||||
logger.info(f"User {current_user.email} paused project {project.slug}")
|
||||
|
||||
# Get project with counts
|
||||
project_data = await project_crud.get_with_counts(db, project_id=updated_project.id)
|
||||
project_data = await project_crud.get_with_counts(
|
||||
db, project_id=updated_project.id
|
||||
)
|
||||
|
||||
if not project_data:
|
||||
raise NotFoundError(
|
||||
@@ -634,7 +640,9 @@ async def resume_project(
|
||||
logger.info(f"User {current_user.email} resumed project {project.slug}")
|
||||
|
||||
# Get project with counts
|
||||
project_data = await project_crud.get_with_counts(db, project_id=updated_project.id)
|
||||
project_data = await project_crud.get_with_counts(
|
||||
db, project_id=updated_project.id
|
||||
)
|
||||
|
||||
if not project_data:
|
||||
raise NotFoundError(
|
||||
|
||||
Reference in New Issue
Block a user