mirror of
https://github.com/Gozargah/Marzban.git
synced 2026-05-17 00:25:53 +03:00
fix value error (#1501)
This commit is contained in:
@@ -100,10 +100,10 @@ class User(BaseModel):
|
||||
@classmethod
|
||||
def validate_note(cls, v):
|
||||
if v and len(v) > 500:
|
||||
raise ValueError("User's note can be a maximum of 500 character", mode="before")
|
||||
raise ValueError("User's note can be a maximum of 500 character")
|
||||
return v
|
||||
|
||||
@field_validator("on_hold_expire_duration", "on_hold_timeout")
|
||||
@field_validator("on_hold_expire_duration", "on_hold_timeout", mode="before")
|
||||
def validate_timeout(cls, v, values):
|
||||
# Check if expire is 0 or None and timeout is not 0 or None
|
||||
if (v in (0, None)):
|
||||
|
||||
Reference in New Issue
Block a user