Skip to content

Commit

Permalink
chore(pydiscordsh): updating the deprecated validator to field_valida…
Browse files Browse the repository at this point in the history
…tor.

Co-authored-by: Bradley Haljendi <[email protected]>
  • Loading branch information
h0lybyte and Fudster committed Jan 10, 2025
1 parent 99b6f57 commit 075c2fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/pydiscordsh/pydiscordsh/api/schema.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Optional, List
import os, re, html
from sqlmodel import Field, Session, SQLModel, create_engine, select, JSON, Column
from pydantic import validator, root_validator
from pydantic import validator, root_validator, field_validator
import logging
from pydiscordsh.api.utils import Utils

Expand Down Expand Up @@ -82,7 +82,7 @@ def validate_common_urls(cls, value):
raise ValueError(f"Invalid URL format for field '{cls.__name__}'. Please provide a valid URL.") from e
return value

@validator("lang", pre=True, always=True)
@field_validator("lang")
def validate_lang(cls, value):
if value:
if len(value) > 2:
Expand Down

0 comments on commit 075c2fb

Please sign in to comment.