validate title_mode [skip ci]

This commit is contained in:
checktheroads 2019-08-23 15:53:31 -07:00
parent 6661c222c0
commit a77651a2d7

View file

@ -325,6 +325,14 @@ class Branding(BaseSettings):
error500: Error500 = Error500()
error504: Error504 = Error504()
@validator("title_mode")
def check_title_mode(cls, v):
"""Verifies title_mode matches supported values"""
supported_modes = ["logo_only", "text_only", "logo_title", "all"]
if v not in supported_modes:
raise ValueError("title_mode must be one of {}".format(supported_modes))
return v
credit: Credit = Credit()
footer: Footer = Footer()
text: Text = Text()