Skip to content

Commit 14834cc

Browse files
committed
formatting code
1 parent e602270 commit 14834cc

File tree

5 files changed

+20
-17
lines changed

5 files changed

+20
-17
lines changed

backend/app/interfaces/volunteer_data_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@ async def update_volunteer_data_by_id(
5050
@abstractmethod
5151
async def delete_volunteer_data_by_id(self, volunteer_data_id: str) -> None:
5252
"""Delete volunteer data by ID"""
53-
pass
53+
pass
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import uuid
22
from datetime import datetime
33

4-
from sqlalchemy import Column, DateTime, ForeignKey, String, Text, UniqueConstraint
4+
from sqlalchemy import Column, DateTime, ForeignKey, Text
55
from sqlalchemy.dialects.postgresql import UUID
66
from sqlalchemy.orm import relationship
77

@@ -10,12 +10,12 @@
1010

1111
class VolunteerData(Base):
1212
__tablename__ = "volunteer_data"
13-
13+
1414
id = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
1515
user_id = Column(UUID(as_uuid=True), ForeignKey("users.id"), nullable=True)
1616
experience = Column(Text, nullable=True)
1717
references_json = Column(Text, nullable=True)
1818
additional_comments = Column(Text, nullable=True)
1919
submitted_at = Column(DateTime, default=datetime.utcnow, nullable=False)
2020

21-
user = relationship("User", back_populates="volunteer_data")
21+
user = relationship("User", back_populates="volunteer_data")

backend/app/routes/volunteer_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,4 @@ async def delete_volunteer_data(
132132
except HTTPException as http_ex:
133133
raise http_ex
134134
except Exception as e:
135-
raise HTTPException(status_code=500, detail=str(e))
135+
raise HTTPException(status_code=500, detail=str(e))

backend/app/schemas/volunteer_data.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class VolunteerDataBase(BaseModel):
1414
"""
1515
Base schema for volunteer data model with common attributes.
1616
"""
17-
17+
1818
experience: Optional[str] = Field(None, description="Volunteer experience description")
1919
references_json: Optional[str] = Field(None, description="JSON string containing references")
2020
additional_comments: Optional[str] = Field(None, description="Additional comments about volunteering")
@@ -24,23 +24,26 @@ class VolunteerDataCreateRequest(VolunteerDataBase):
2424
"""
2525
Request schema for creating volunteer data
2626
"""
27-
28-
user_id: Optional[UUID] = Field(None, description="User ID this volunteer data belongs to (optional for public submissions)")
27+
28+
user_id: Optional[UUID] = Field(
29+
None,
30+
description="User ID this volunteer data belongs to (optional for public submissions)"
31+
)
2932

3033

3134
class VolunteerDataPublicSubmission(VolunteerDataBase):
3235
"""
3336
Request schema for public volunteer data submissions (no user_id required)
3437
"""
35-
38+
3639
pass
3740

3841

3942
class VolunteerDataUpdateRequest(BaseModel):
4043
"""
4144
Request schema for updating volunteer data, all fields optional
4245
"""
43-
46+
4447
experience: Optional[str] = Field(None, description="Volunteer experience description")
4548
references_json: Optional[str] = Field(None, description="JSON string containing references")
4649
additional_comments: Optional[str] = Field(None, description="Additional comments about volunteering")
@@ -50,7 +53,7 @@ class VolunteerDataResponse(BaseModel):
5053
"""
5154
Response schema for volunteer data
5255
"""
53-
56+
5457
id: UUID
5558
user_id: UUID
5659
experience: Optional[str]
@@ -65,6 +68,6 @@ class VolunteerDataListResponse(BaseModel):
6568
"""
6669
Response schema for listing volunteer data
6770
"""
68-
71+
6972
volunteer_data: List[VolunteerDataResponse]
70-
total: int
73+
total: int

backend/app/services/implementations/volunteer_data_service.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ async def create_volunteer_data(
3232
)
3333
if existing_data:
3434
raise HTTPException(
35-
status_code=409,
35+
status_code=409,
3636
detail="Volunteer data already exists for this user"
3737
)
3838

@@ -66,7 +66,7 @@ async def get_volunteer_data_by_id(self, volunteer_data_id: str) -> VolunteerDat
6666
)
6767
if not volunteer_data:
6868
raise HTTPException(status_code=404, detail="Volunteer data not found")
69-
69+
7070
return VolunteerDataResponse.model_validate(volunteer_data)
7171
except ValueError:
7272
raise HTTPException(status_code=400, detail="Invalid volunteer data ID format")
@@ -85,7 +85,7 @@ async def get_volunteer_data_by_user_id(self, user_id: str) -> VolunteerDataResp
8585
)
8686
if not volunteer_data:
8787
raise HTTPException(status_code=404, detail="Volunteer data not found for this user")
88-
88+
8989
return VolunteerDataResponse.model_validate(volunteer_data)
9090
except ValueError:
9191
raise HTTPException(status_code=400, detail="Invalid user ID format")
@@ -154,4 +154,4 @@ async def delete_volunteer_data_by_id(self, volunteer_data_id: str) -> None:
154154
except Exception as e:
155155
self.db.rollback()
156156
self.logger.error(f"Error deleting volunteer data {volunteer_data_id}: {str(e)}")
157-
raise HTTPException(status_code=500, detail=str(e))
157+
raise HTTPException(status_code=500, detail=str(e))

0 commit comments

Comments
 (0)