File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 33
44from mavedb .lib .validation import keywords
55from mavedb .lib .validation .exceptions import ValidationError
6+ from mavedb .lib .validation .utilities import is_null
67from mavedb .view_models import PublicationIdentifiersGetter
78from mavedb .view_models .base .base import BaseModel , validator
89from mavedb .view_models .doi_identifier import (
@@ -72,6 +73,12 @@ def validate_keywords(cls, v):
7273 keywords .validate_keywords (v )
7374 return v
7475
76+ @validator ("title" , "short_description" , "abstract_text" , "method_text" )
77+ def validate_field_is_non_empty (cls , v ):
78+ if is_null (v ) or not isinstance (v , str ):
79+ raise ValidationError ("This field is required and cannot be empty." )
80+ return v .strip ()
81+
7582
7683class ExperimentCreate (ExperimentModify ):
7784 experiment_set_urn : Optional [str ]
You can’t perform that action at this time.
0 commit comments