mirror of
https://github.com/thatmattlove/hyperglass.git
synced 2026-04-29 19:26:21 +00:00
validate title_mode [skip ci]
This commit is contained in:
parent
6661c222c0
commit
a77651a2d7
1 changed files with 8 additions and 0 deletions
|
|
@ -325,6 +325,14 @@ class Branding(BaseSettings):
|
||||||
error500: Error500 = Error500()
|
error500: Error500 = Error500()
|
||||||
error504: Error504 = Error504()
|
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()
|
credit: Credit = Credit()
|
||||||
footer: Footer = Footer()
|
footer: Footer = Footer()
|
||||||
text: Text = Text()
|
text: Text = Text()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue