File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,11 @@ class Meta:
2626
2727 @validates_schema
2828 def validate_length (self , data ):
29+ if 'length' not in data :
30+ raise UnprocessableEntityError (
31+ {'pointer' : '/data/attributes/length' },
32+ "Length attribute is missing" ,
33+ )
2934 try :
3035 datetime .strptime (data ['length' ], '%H:%M' )
3136 except ValueError :
Original file line number Diff line number Diff line change @@ -26,6 +26,11 @@ class Meta:
2626
2727 @validates_schema
2828 def valid_color (self , data ):
29+ if 'color' not in data :
30+ raise UnprocessableEntityError (
31+ {'pointer' : '/data/attributes/color' },
32+ "Color attribut is required" ,
33+ )
2934 if not re .search (r'^#(?:[0-9a-fA-F]{3}){1,2}$' , data ['color' ]):
3035 raise UnprocessableEntityError (
3136 {'pointer' : 'data/attributes/color' },
You can’t perform that action at this time.
0 commit comments