Skip to content
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

feat: Validate Data options and Data values #9784

Merged
merged 21 commits into from Apr 1, 2020

Conversation

gavindsouza
Copy link
Collaborator

@gavindsouza gavindsouza commented Mar 25, 2020

DocType Validations:

Screenshot 2020-03-25 at 3 12 04 PM

Document Validations:

Screenshot 2020-03-25 at 4 20 12 PM

Client Side Validation:

2020-03-25 16 22 49

Server Side Validation:

2020-03-25 16 24 01

Other fixes:

  • fix: ValidationError message for "{email_id} is not a valid Email Address"

Docs Link

for fieldtype "Data" and options set to "Email" or "Phone", updating
    documents will trigger data validations for email and phone numbers will be made
added set_invalid control for docfields. On event of docfield.invalid is
set, in a given form, set_invalid will be executed which changes the
textbox colour to red
returning empty string if parseaddr returns None shows " is not a valid Email Address"

eg: if 'email@' is passed as value, email.utils.parseaddr will return a
(None, None) tuple
frappe/core/doctype/doctype/doctype.py Outdated Show resolved Hide resolved
frappe/core/doctype/doctype/doctype.py Show resolved Hide resolved
frappe/public/js/frappe/form/controls/data.js Outdated Show resolved Hide resolved
frappe/utils/__init__.py Show resolved Hide resolved
@surajshetty3416 surajshetty3416 changed the title feat: Data options feat: Validate Data options and Data values Mar 26, 2020
@gavindsouza gavindsouza force-pushed the data-options branch 3 times, most recently from b17da92 to ec837a5 Compare March 30, 2020 15:21
surajshetty3416
surajshetty3416 previously approved these changes Apr 1, 2020
Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>
@gavindsouza
Copy link
Collaborator Author

In submitted documents, if "Allow on submit" is enabled for certain fields, when the document is validated again, in case the Data fields throw ValidationError, the user may not be able to update those fields. This feature will stay in develop for this reason and will not be backported to previous versions.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants