code cleanup

This commit is contained in:
hay-kot 2021-03-30 11:13:34 -08:00
commit af07068144
3 changed files with 3 additions and 11 deletions

View file

@ -43,6 +43,7 @@ class Recipe(BaseModel):
recipeIngredient: Optional[list[str]]
recipeInstructions: Optional[list[RecipeStep]]
nutrition: Optional[Nutrition]
tools: Optional[list[str]] = []
totalTime: Optional[str] = None
prepTime: Optional[str] = None
@ -67,6 +68,7 @@ class Recipe(BaseModel):
"recipeIngredient": [x.ingredient for x in name_orm.recipeIngredient],
"recipeCategory": [x.name for x in name_orm.recipeCategory],
"tags": [x.name for x in name_orm.tags],
"tools": [x.tool for x in name_orm.tools],
"extras": {x.key_name: x.value for x in name_orm.extras},
}

View file

@ -1,10 +0,0 @@
from pydantic import BaseModel
class WebhookJob(BaseModel):
webhook_urls: list[str] = []
webhook_time: str = "00:00"
webhook_enable: bool
class Config:
orm_mode = True

View file

@ -7,7 +7,7 @@ from sqlalchemy.orm.session import Session
def post_webhooks(group: int, session: Session = None):
session = session if session else create_session()
session = session or create_session()
group_settings: GroupInDB = db.groups.get(session, group)
if not group_settings.webhook_enable: