Files
mealie/mealie/schema/response/__init__.py
Hayden 6db1357064 feat: (WIP) base-shoppinglist infra (#911)
* feat:  base-shoppinglist infra (WIP)

* add type checker

* implement controllers

* apply router fixes

* add checked section hide/animation

* add label support

* formatting

* fix overflow images

* add experimental banner

* fix #912 word break issue

* remove any type errors

* bump dependencies

* remove templates

* fix build errors

* bump node version

* fix template literal
2022-01-08 22:24:34 -09:00

18 lines
510 B
Python

from typing import Optional
from pydantic import BaseModel
class ErrorResponse(BaseModel):
message: str
error: bool = True
exception: Optional[str] = None
@classmethod
def respond(cls, message: str, exception: Optional[str] = None) -> dict:
"""
This method is an helper to create an obect and convert to a dictionary
in the same call, for use while providing details to a HTTPException
"""
return cls(message=message, exception=exception).dict()