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 88
99from mavedb .lib .validation import keywords , urn_re
1010from mavedb .lib .validation .exceptions import ValidationError
11+ from mavedb .lib .validation .utilities import is_null
1112from mavedb .models .enums .processing_state import ProcessingState
1213from mavedb .models .target_sequence import TargetSequence
1314from mavedb .view_models import PublicationIdentifiersGetter
@@ -68,6 +69,12 @@ class ScoreSetModify(ScoreSetBase):
6869 doi_identifiers : Optional [list [DoiIdentifierCreate ]]
6970 target_genes : list [TargetGeneCreate ]
7071
72+ @validator ("title" , "short_description" , "abstract_text" , "method_text" )
73+ def validate_field_is_non_empty (cls , v ):
74+ if is_null (v ) or not isinstance (v , str ):
75+ raise ValidationError ("This field is required and cannot be empty." )
76+ return v .strip ()
77+
7178 @validator ("primary_publication_identifiers" )
7279 def max_one_primary_publication_identifier (cls , v ):
7380 if isinstance (v , list ):
You can’t perform that action at this time.
0 commit comments