Open
Conversation
da80b28 to
5cf8f39
Compare
5cf8f39 to
85403a0
Compare
staverne
added a commit
that referenced
this pull request
Dec 1, 2016
Fix ipkg-update-locale.py after pip compliance update
fchenebault
suggested changes
Dec 2, 2016
| class BaseValidator(validator_prototype): | ||
|
|
||
| validator_id = None | ||
| errors = {'invalid': MSG(u'Enter a valid value')} |
|
|
||
|
|
||
| def check(self, value): | ||
| raise NotImplementedError('Validator is not configured') |
There was a problem hiding this comment.
Validor must implement the check method
|
|
||
| validator_id = 'hexadecimal' | ||
| regex = '^#[A-Fa-f0-9]+$' | ||
| errors = {'invalid': MSG(u'Enter a valid value.')} |
| class PositiveIntegerValidator(BaseValidator): | ||
|
|
||
| validator_id = 'integer-positive' | ||
| errors = {'integer_positive': MSG(u'Ensure this value is positive.')} |
There was a problem hiding this comment.
The value must be a positive integer
| class PositiveIntegerValidator(BaseValidator): | ||
|
|
||
| validator_id = 'integer-positive' | ||
| errors = {'integer_positive': MSG(u'Ensure this value is positive.')} |
There was a problem hiding this comment.
C'est bizarre de définir des messages d'erreur différents à chaque fois alors que tu check juste si c'est valide ou non
| errors = { | ||
| 'too_short': MSG(u"This password is too short. It must contain at least {min_length} characters."), | ||
| 'need_character': MSG(u"This password should contains at least one character."), | ||
| 'need_number': MSG(u"This password should contains at least one number."), |
There was a problem hiding this comment.
Password must contain at least one number
| 'too_short': MSG(u"This password is too short. It must contain at least {min_length} characters."), | ||
| 'need_character': MSG(u"This password should contains at least one character."), | ||
| 'need_number': MSG(u"This password should contains at least one number."), | ||
| 'need_special_character': MSG(u"This password should contains at least one special character."), |
There was a problem hiding this comment.
Password must contain at least one special character (=,+,-,_,$,...)
| elif self.msg: | ||
| messages = [self.msg] | ||
| else: | ||
| messages = MSG(u'There are errors... XXX') |
| else: | ||
| unknow.append(name) | ||
| if missings or invalids or unknow: | ||
| error_msg = error_msg or ERROR(u'Form values are invalid') |
| return self.schema | ||
|
|
||
|
|
||
| form_error_message = ERROR(u'There are errors, check below') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.