in src/Backend/src/api/helpers/schemas.py [0:0]
def prevent_none(cls, q: str | None) -> str | None:
"""
Validator to ensure that, if the field is sent, it's not None.
"""
if q and q.strip() != "":
if len(q) < 3:
raise errors.FieldShouldBeLenghtier(field="q", min_length=3)
return urllib.parse.unquote(q)
return None