Skip to content

Commit

Permalink
pb self or cls
Browse files Browse the repository at this point in the history
  • Loading branch information
camillebrianceau committed Nov 6, 2024
1 parent 0f98a8e commit 1378ab0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion clinicadl/utils/iotools/clinica_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,14 @@ class FileType(BaseModel):
needed_pipeline: Optional[str] = None

@field_validator("pattern", mode="before")
def check_pattern(self, v):
def check_pattern(cls, v):
if v[0] == "/":
raise ValueError(
"pattern argument cannot start with char: / (does not work in os.path.join function). "
"If you want to indicate the exact name of the file, use the format "
"directory_name/filename.extension or filename.extension in the pattern argument."
)
return v


class FileReader(BaseModel):
Expand Down

0 comments on commit 1378ab0

Please sign in to comment.