1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-24 07:39:41 +02:00

feat: add on mounted hook for bookmarklets (#1120)

* add utility type to hide Advanced items

* add default text

* fix #1115 and minor refactorings

* generate types

* hotfix: add validator to catch null vlaues
This commit is contained in:
Hayden 2022-04-01 11:05:25 -08:00 committed by GitHub
parent cfaac2e060
commit 3e3b43c977
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 96 additions and 30 deletions

View file

@ -17,6 +17,10 @@ class CreateCookBook(MealieModel):
tags: list[TagBase] = []
tools: list[RecipeTool] = []
@validator("public", always=True, pre=True)
def validate_public(public: bool | None, values: dict) -> bool: # type: ignore
return False if public is None else public
@validator("slug", always=True, pre=True)
def validate_slug(slug: str, values): # type: ignore
name: str = values["name"]