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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Mukul
erp5
Commits
14c8b879
Commit
14c8b879
authored
Mar 05, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Generate message in case of object modification.
parent
58cf7f14
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
product/ERP5Type/Constraint/PropertyTypeValidity.py
product/ERP5Type/Constraint/PropertyTypeValidity.py
+6
-1
No files found.
product/ERP5Type/Constraint/PropertyTypeValidity.py
View file @
14c8b879
...
@@ -73,7 +73,7 @@ class PropertyTypeValidity(Constraint):
...
@@ -73,7 +73,7 @@ class PropertyTypeValidity(Constraint):
" (Type cast failed with error ${type_cast_error})"
" (Type cast failed with error ${type_cast_error})"
message_incorrect_type_fixed
=
"Attribute ${attribute_name}"
\
message_incorrect_type_fixed
=
"Attribute ${attribute_name}"
\
" should be of type ${expected_type} but is of type ${actual_type} (Fixed)"
" should be of type ${expected_type} but is of type ${actual_type} (Fixed)"
message_value_modified
=
"Value of '${key}' was modified from '${old}' to '${new}'."
def
_checkConsistency
(
self
,
obj
,
fixit
=
0
):
def
_checkConsistency
(
self
,
obj
,
fixit
=
0
):
"""Check the object's consistency.
"""Check the object's consistency.
...
@@ -86,6 +86,8 @@ class PropertyTypeValidity(Constraint):
...
@@ -86,6 +86,8 @@ class PropertyTypeValidity(Constraint):
property_type
=
'lines'
property_type
=
'lines'
else
:
else
:
property_type
=
prop
[
'type'
]
property_type
=
prop
[
'type'
]
if
property_id
==
'password'
:
import
ipdb
;
ipdb
.
set_trace
()
# if this property was a local property and has been later added in a
# if this property was a local property and has been later added in a
# property sheet, we want to remove it from _local_properties
# property sheet, we want to remove it from _local_properties
...
@@ -138,6 +140,9 @@ class PropertyTypeValidity(Constraint):
...
@@ -138,6 +140,9 @@ class PropertyTypeValidity(Constraint):
elif
fixit
:
elif
fixit
:
oldvalue
=
getattr
(
obj
,
property_id
,
value
)
oldvalue
=
getattr
(
obj
,
property_id
,
value
)
if
oldvalue
!=
value
:
if
oldvalue
!=
value
:
error_list
.
append
(
self
.
_generateError
(
obj
,
self
.
_getMessage
(
'message_value_modified'
),
dict
(
key
=
property_id
,
old
=
oldvalue
,
new
=
value
)))
obj
.
setProperty
(
property_id
,
oldvalue
)
obj
.
setProperty
(
property_id
,
oldvalue
)
return
error_list
return
error_list
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