Skip to content

Commit

Permalink
feat(core): upgrade to latest fastapi
Browse files Browse the repository at this point in the history
  • Loading branch information
mikonse committed Aug 26, 2023
1 parent b21e88d commit 5130ce9
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
22 changes: 11 additions & 11 deletions abrechnung/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@ class ServiceConfig(BaseModel):


class DemoConfig(BaseModel):
enabled = False
wipe_interval = timedelta(hours=1)
enabled: bool = False
wipe_interval: timedelta = timedelta(hours=1)


class ApiConfig(BaseModel):
secret_key: str
host: str
port: int
id = "default"
max_uploadable_file_size = 1024
enable_cors = True
access_token_validity = timedelta(hours=1)
id: str = "default"
max_uploadable_file_size: int = 1024
enable_cors: bool = True
access_token_validity: timedelta = timedelta(hours=1)


class RegistrationConfig(BaseModel):
enabled = False
allow_guest_users = False
enabled: bool = False
allow_guest_users: bool = False
valid_email_domains: Optional[List[str]] = None


Expand All @@ -49,7 +49,7 @@ class AuthConfig(BaseModel):
address: str
host: str
port: int
mode = "smtp" # oneof "local" "smtp-ssl" "smtp-starttls" "smtp"
mode: str = "smtp" # oneof "local" "smtp-ssl" "smtp-starttls" "smtp"
auth: Optional[AuthConfig] = None


Expand All @@ -59,8 +59,8 @@ class Config(BaseModel):
database: DatabaseConfig
email: EmailConfig
# in case all params are optional this is needed to make the whole section optional
demo = DemoConfig()
registration = RegistrationConfig()
demo: DemoConfig = DemoConfig()
registration: RegistrationConfig = RegistrationConfig()


def read_config(config_path: Path) -> Config:
Expand Down
2 changes: 1 addition & 1 deletion abrechnung/http/routers/accounts.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class BaseAccountPayload(BaseModel):
date_info: Optional[date] = None
tags: Optional[List[str]] = None
owning_user_id: Optional[int] = None
clearing_shares: ClearingShares
clearing_shares: ClearingShares = None


class CreateAccountPayload(BaseAccountPayload):
Expand Down
2 changes: 1 addition & 1 deletion abrechnung/http/routers/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class VersionResponse(BaseModel):
patch_version: int

class Config:
schema_extra = {
json_schema_extra = {
"example": {
"version": "1.3.2",
"major_version": 1,
Expand Down
2 changes: 1 addition & 1 deletion abrechnung/http/routers/groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class GroupPayload(BaseModel):
name: str
description: str = ""
currency_symbol: str
add_user_account_on_join = False
add_user_account_on_join: bool = False
terms: str = ""


Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ classifiers = [
]
requires-python = ">=3.9"
dependencies = [
"fastapi~=0.88",
"fastapi~=0.102",
"pydantic[email]~=2.3.0",
"uvicorn[standard]~=0.20",
"python-jose[cryptography]~=3.3",
"asyncpg~=0.27",
"passlib[bcrypt]~=1.7",
"websockets~=10.4",
"python-multipart~=0.0.5",
"PyYAML~=6.0",
"email-validator~=1.3",
"schema~=0.7",
]

Expand Down

0 comments on commit 5130ce9

Please sign in to comment.