Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrOertlin committed Apr 5, 2024
1 parent 8e82b94 commit 57d626c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions genotype_api/api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@
from fastapi.responses import JSONResponse
from fastapi.middleware.cors import CORSMiddleware

from genotype_api.config import security_settings, DBSettings, settings
from genotype_api.config import security_settings, settings
from genotype_api.database.database import create_all_tables, initialise_database, close_session
from genotype_api.api.endpoints import samples, snps, users, plates, analyses
from sqlalchemy.exc import NoResultFound

app = FastAPI(
root_path=security_settings.api_root_path,
root_path_in_servers=True,
openapi_prefix=security_settings.api_root_path,
)
app.add_middleware(
CORSMiddleware,
Expand Down
4 changes: 2 additions & 2 deletions genotype_api/dto/plate.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class PlateStatusCounts(BaseModel):
commented: int = Field(0, nullable=True)

class Config:
allow_population_by_field_name = True
populate_by_name = True


class UserOnPlate(BaseModel):
Expand Down Expand Up @@ -66,4 +66,4 @@ def check_detail(cls, value, values):
return PlateStatusCounts(**status_counts, total=len(analyses), commented=commented)

class Config:
validate_all = True
validate_default = True
2 changes: 1 addition & 1 deletion genotype_api/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def validate_status(cls, value, values) -> SampleDetailStatus:
return SampleDetailStatus(sex=sex, snps=snps, nocalls=nocalls)

class Config:
validate_all = True
validate_default = True


class MatchCounts(BaseModel):
Expand Down

0 comments on commit 57d626c

Please sign in to comment.