-
-
Notifications
You must be signed in to change notification settings - Fork 252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Max chars input validation #375
Conversation
src/model/parameter_config.py
Outdated
@@ -277,6 +279,9 @@ def validate_value(self, value, *, ignore_required=False): | |||
return None | |||
|
|||
if self.type == 'text': | |||
if (not is_empty(self.max_chars)) and (len(value) > int(self.max_chars)): | |||
return 'is greater than allowed char length (' \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you change "greater" to "longer?
src/model/parameter_config.py
Outdated
@@ -27,6 +27,7 @@ | |||
'type', | |||
'min', | |||
'max', | |||
'max_chars', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may be we could call it "max_length"? What do you think?
61026aa
to
9f40c57
Compare
Got a little confused and mistakenly pushed something else. Please have another look. Apologies for that. |
@bugy is there anything else required here? |
Oh, damn, i forgot about it, sorry :(
… @bugy <https://github.com/bugy> is there anything else required here?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#375 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJXPJLZPS4552AHRRZTHZ3SVRR5HANCNFSM4UVRZ6EQ>
.
|
Adding
max_chars
config parameter to a text field.I sometime require limit user input to specific number of chars. I've been doing this until now with-in the executed script but I find it much useful this way.