diff options
author | 2020-12-15 08:13:37 +0300 | |
---|---|---|
committer | 2020-12-15 08:13:37 +0300 | |
commit | 947a30f7406b7d025cf2e5754b59389af4213718 (patch) | |
tree | c6236edb812db32f583ac0acc9099be33d1a0e2b /backend/models/form.py | |
parent | Add ks123 (GH ks129) to CODEOWNERS (diff) |
fix various type annotation issues
Diffstat (limited to 'backend/models/form.py')
-rw-r--r-- | backend/models/form.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/backend/models/form.py b/backend/models/form.py index 2cf8486..21cc549 100644 --- a/backend/models/form.py +++ b/backend/models/form.py @@ -12,8 +12,8 @@ class Form(BaseModel): """Schema model for form.""" id: str = Field(alias="_id") - features: t.List[str] - questions: t.List[Question] + features: list[str] + questions: list[Question] name: str description: str @@ -21,7 +21,7 @@ class Form(BaseModel): allow_population_by_field_name = True @validator("features") - def validate_features(cls, value: t.List[str]) -> t.Optional[t.List[str]]: + def validate_features(cls, value: list[str]) -> t.Optional[list[str]]: """Validates is all features in allowed list.""" # Uppercase everything to avoid mixed case in DB value = [v.upper() for v in value] @@ -34,7 +34,7 @@ class Form(BaseModel): return value - def dict(self, admin: bool = True, **kwargs: t.Dict) -> t.Dict[str, t.Any]: + def dict(self, admin: bool = True, **kwargs: t.Any) -> dict[str, t.Any]: """Wrapper for original function to exclude private data for public access.""" data = super().dict(**kwargs) |