mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-07 11:45:24 +03:00
Fix mqtt config validation
This commit is contained in:
parent
f591124f2f
commit
348ec34669
@ -154,7 +154,7 @@ class MqttConfig(FrigateBaseModel):
|
|||||||
@field_validator("password", mode="before")
|
@field_validator("password", mode="before")
|
||||||
@classmethod
|
@classmethod
|
||||||
def validate_password(cls, v, info: ValidationInfo):
|
def validate_password(cls, v, info: ValidationInfo):
|
||||||
if (v is None) != (info.config.get("user") is None):
|
if (v is None) != (info.data.get("user") is None):
|
||||||
raise ValueError("Password must be provided with username.")
|
raise ValueError("Password must be provided with username.")
|
||||||
return v
|
return v
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user