Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
141
Merge Requests
141
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
9ec0e743
Commit
9ec0e743
authored
Aug 29, 2017
by
Tomáš Peterka
Committed by
Tomáš Peterka
Sep 01, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ERP5Form] MatrixBox calls external validators on its subfields
parent
1166034f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
product/ERP5Form/MatrixBox.py
product/ERP5Form/MatrixBox.py
+9
-2
No files found.
product/ERP5Form/MatrixBox.py
View file @
9ec0e743
...
@@ -591,8 +591,15 @@ class MatrixBoxValidator(Validator.Validator):
...
@@ -591,8 +591,15 @@ class MatrixBoxValidator(Validator.Validator):
cell
=
cell
,
cell_index
=
kw
,
cell_position
=
((
i
,
j
,
k
)
+
extra_dimension_position
))
cell
=
cell
,
cell_index
=
kw
,
cell_position
=
((
i
,
j
,
k
)
+
extra_dimension_position
))
value
=
None
value
=
None
try
:
try
:
value
=
my_field
.
validator
.
validate
(
# We call directly Validator's validate method to pass our own key
my_field
,
key
,
REQUEST
)
# because Field.validate always computes the key from field properties
value
=
my_field
.
validator
.
validate
(
my_field
,
key
,
REQUEST
)
# Unfortunately the call to external validator is implemented within
# field's `validate` method. Since we call the validator's validate
# directly, we need to copy&paste call to external validator from Field's validate here
external_validator
=
my_field
.
get_value
(
'external_validator'
)
if
external_validator
and
not
external_validator
(
value
,
REQUEST
):
my_field
.
validator
.
raise_error
(
'external_validator_failed'
,
my_field
)
except
ValidationError
,
err
:
except
ValidationError
,
err
:
err
.
field_id
=
my_field
.
id
+
'_cell_%s_%s_%s%s'
%
(
i
,
j
,
k
,
extra_dimension_index
)
err
.
field_id
=
my_field
.
id
+
'_cell_%s_%s_%s%s'
%
(
i
,
j
,
k
,
extra_dimension_index
)
error_list
.
append
(
err
)
error_list
.
append
(
err
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment