[Sqlalchemy-tickets] Issue #3776: Validating a field multiple times with different @validates decor
Brought to you by:
zzzeek
From: cdnsteve <iss...@bi...> - 2016-08-18 15:48:12
|
New issue 3776: Validating a field multiple times with different @validates decorators is causing them to be skipped https://bitbucket.org/zzzeek/sqlalchemy/issues/3776/validating-a-field-multiple-times-with cdnsteve: If a field has multiple @validates decorators it will not consistently validate each of them properly and cause subsequent @validates to be skipped. Example: the second validator, validate_field_positive_number, will not get run. ``` #!python @validates('email') def validate_test_123(self, key, field): return field @validates('email') def validate_field_positive_number(self, key, field): if True: raise ValidationError('failed multiple validation') return field ``` If you run it the first time. Validation will pass. If you remove/delete the validate_test_123 decorator and validation, the second one will always work. Thanks, Steve |