Commit a3788bbe authored by Arnaud Fontaine's avatar Arnaud Fontaine

Remove useless message_property_not_set because calling getProperty()

will never be called after hasProperty()


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@41787 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5f95e7ef
......@@ -36,14 +36,12 @@ class M0Constraint:
'type' : 'PropertyExistence',
'title' : None,
'message_no_such_property': 'The naming must be defined',
'message_property_not_set': 'The naming must be defined',
},
{ 'id' : 'name_existence',
'description' : 'Property name must be definied',
'type' : 'PropertyExistence',
'name' : None,
'message_no_such_property': 'The commercial name must be defined',
'message_property_not_set': 'The commercial name must be defined',
},
{ 'id' : 'head_office_address_existence',
'description' : 'Property address must be definied',
......
......@@ -41,7 +41,6 @@ class M2Constraint:
# 'type' : 'PropertyExistence',
# 'corporate_registration_code' : None,
# 'message_no_such_property': 'The corporate registration must be defined',
# 'message_property_not_set': 'The corporate registration must be defined',
# },
# { 'id' : 'old_headquarters_existence',
# 'description' : 'Property old_headquarters must be definied',
......
......@@ -36,7 +36,6 @@ class M4Constraint:
'type' : 'PropertyExistence',
'title' : None,
'message_no_such_property': 'The naming must be defined',
'message_property_not_set': 'The naming must be defined',
},
{ 'id' : 'corporate_registration_code_existence',
'description' : 'Property corporate registration code must be definied',
......
......@@ -36,14 +36,12 @@ class P0Constraint:
'type' : 'PropertyExistence',
'last_name' : None,
'message_no_such_property': 'The last name must be defined',
'message_property_not_set': 'The last name must be defined',
},
{ 'id' : 'first_name_existence',
'description' : 'Property first name code must be definied',
'type' : 'PropertyExistence',
'first_name' : None,
'message_no_such_property': 'The first name address must be defined',
'message_property_not_set': 'The first name address must be defined',
},
{ 'id' : 'date_exitence',
'description' : 'Property date must be definied',
......@@ -166,6 +164,5 @@ class P0Constraint:
'previous_activity_corporate_registration_code' : None,
'condition' : 'python: object.getActivityRestartCheck() ==1',
'message_no_such_property': 'for a restart activity you must define the previous registration code',
'message_property_not_set': 'for a restart activity you must define the previous registration code',
},
)
......@@ -36,14 +36,12 @@ class P2Constraint:
'type' : 'PropertyExistence',
'owner_last_name' : None,
'message_no_such_property': 'The owner last name must be defined',
'message_property_not_set': 'The owner last name must be defined',
},
{ 'id' : 'owner_first_name_existence',
'description' : 'Property owner first name code must be definied',
'type' : 'PropertyExistence',
'owner_first_name' : None,
'message_no_such_property': 'The owner first name address must be defined',
'message_property_not_set': 'The owner first name address must be defined',
},
{ 'id' : 'date_existence',
'description' : 'Property date must be definied',
......@@ -80,7 +78,6 @@ class P2Constraint:
'company_corporate_registration_code' : None,
'condition' : 'python: object.getCompanyModifications() != None',
'message_no_such_property': 'for an orgnisation modification you must define the company registration code',
'message_property_not_set': 'for an orgnisation modification you must define the company registration code',
},
{ 'id' : 'establishment_corporate_registration_code_existence',
'description' : 'Property must be definied',
......@@ -88,6 +85,5 @@ class P2Constraint:
'establishment_corporate_registration_code' : None,
'condition' : 'python: object.getEstablishmentModification() != None',
'message_no_such_property': 'for an establishment modification you must define the establishment registration code',
'message_property_not_set': 'for an establishment modification you must define the establishment registration code',
},
)
......@@ -36,14 +36,12 @@ class P4Constraint:
'type' : 'PropertyExistence',
'owner_last_name' : None,
'message_no_such_property': 'The owner last name must be defined',
'message_property_not_set': 'The owner last name must be defined',
},
{ 'id' : 'owner_first_name_existence',
'description' : 'Property owner first name code must be definied',
'type' : 'PropertyExistence',
'owner_first_name' : None,
'message_no_such_property': 'The owner first name address must be defined',
'message_property_not_set': 'The owner first name address must be defined',
},
{ 'id' : 'corporate_registration_code_existence',
'description' : 'Property corporate registration code must be definied',
......
......@@ -36,7 +36,6 @@ class S1Constraint:
'type' : 'PropertyExistence',
'title' : None,
'message_no_such_property': 'The denomination must be defined',
'message_property_not_set': 'The denomination must be defined',
},
{ 'id' : 'hypothecation_person_title_existence',
'description' : 'Property hypothecation person title must be definied',
......
......@@ -36,7 +36,6 @@ class S5Constraint:
'type' : 'PropertyExistence',
'title' : None,
'message_no_such_property': 'The denomination must be defined',
'message_property_not_set': 'The denomination must be defined',
},
{ 'id' : 'inscription_person_title_existence',
'description' : 'Property inscription person title must be definied',
......
934
\ No newline at end of file
935
\ No newline at end of file
......@@ -54,7 +54,6 @@ class InventoryConstraint:
'description' : 'Start Date must be defined',
'type' : 'PropertyExistence',
'start_date' : 1,
'message_property_not_set': 'Inventory Date must be defined',
'message_no_such_property': 'Inventory Date must be defined',
},
{ 'id' : 'resource_on_line',
......
1096
\ No newline at end of file
1097
\ No newline at end of file
......@@ -33,14 +33,12 @@ class SoftwareInstanceConstraint:
'description' : 'Property text content must be defined',
'type' : 'PropertyExistence',
'text_content' : None,
"message_property_not_set" : 'XML must be set',
"message_no_such_property" : 'XML must be set'
},
{ 'id' : 'property_existence',
'description' : 'Property reference must be defined',
'type' : 'PropertyExistence',
'reference' : None,
"message_property_not_set" : 'Reference must be set',
"message_no_such_property" : 'Reference must be set'
},
{ 'id' : 'text_content_validation',
......
177
\ No newline at end of file
178
\ No newline at end of file
......@@ -45,7 +45,6 @@ class AccountingTransactionConstraint:
{ 'id': 'date_existence',
'description': 'Date must be defined',
'message_property_not_set': 'Date must be defined',
'message_no_such_property': 'Date must be defined',
'condition' : 'python: object.getSimulationState() not'
' in ("cancelled", "deleted")'
......@@ -56,7 +55,6 @@ class AccountingTransactionConstraint:
{ 'id': 'date_existence_purchase',
'description': 'Date must be defined',
'message_property_not_set': 'Date must be defined',
'message_no_such_property': 'Date must be defined',
'condition' : 'python: object.getSimulationState() not'
' in ("cancelled", "deleted")'
......
......@@ -37,7 +37,6 @@ class BugConstraint:
'description' : 'Title must be defined',
'type' : 'PropertyExistence',
'title' : None,
'message_property_not_set': 'Title must be defined',
'message_no_such_property' : 'Title must be defined',
},
{ 'id' : 'tested_existence',
......@@ -45,7 +44,6 @@ class BugConstraint:
'type' : 'PropertyExistence',
'tested' : 0,
'condition' : "python: object.getSimulationState() in ['ready','stopped']" ,
'message_property_not_set': 'Tested is unchecked, Must have a Unit/Funcional test for this',
'message_no_such_property' : 'Tested is unchecked, Must have a Unit/Funcional test for this',
},
{ 'id' : 'source_project_category_membership_arity',
......@@ -61,7 +59,6 @@ class BugConstraint:
'description' : 'Property start_date must be defined',
'type' : 'PropertyExistence',
'start_date' : None,
'message_property_not_set': 'Begin Date must be defined',
'message_no_such_property' : 'Begin Date must be defined'
},
{ 'id' : 'date_coherency',
......
......@@ -35,7 +35,6 @@ class CalendarPeriodConstraint:
{ 'id': 'start_date_existence',
'description': 'Date must be defined',
'message_property_not_set': 'Start date must be defined',
'message_no_such_property': 'Start date must be defined',
'type': 'PropertyExistence',
'start_date' : 1,
......@@ -43,7 +42,6 @@ class CalendarPeriodConstraint:
{ 'id': 'stop_date_existence',
'description': 'Date must be defined',
'message_property_not_set': 'Stop date must be defined',
'message_no_such_property': 'Stop date must be defined',
'type': 'PropertyExistence',
'stop_date' : 1,
......
......@@ -64,7 +64,6 @@ class ProductionOrder:
'type' : 'PropertyExistence',
'start_date' : 1,
'message_no_such_property' : "Shipping Date must be defined",
'message_property_not_set' : "Shipping Date must be defined",
},
{ 'id' : 'date_coherency',
'description' : 'Stop Date must be after Start Date',
......
......@@ -55,7 +55,6 @@ class TaskConstraint:
'description' : 'Property start_date must be defined',
'type' : 'PropertyExistence',
'start_date' : None,
'message_property_not_set': 'Begin Date must be defined',
'message_no_such_property' : 'Begin Date must be defined'
},
{ 'id' : 'date_coherency',
......
......@@ -35,7 +35,6 @@ class TaskLineConstraint:
'description' : 'Property quantity must be defined',
'type' : 'PropertyExistence',
'quantity' : None,
"message_property_not_set" : 'Quantity must be defined in lines',
"message_no_such_property" : 'Quantity must be defined in lines'
},
{ 'id' : 'resource',
......
......@@ -35,7 +35,6 @@ class TradeConditionConstraint:
'description' : 'Property reference must be defined',
'type' : 'PropertyExistence',
'reference' : None,
"message_property_not_set" : 'Reference must be defined',
"message_no_such_property" : 'Reference must be defined'
},
{ 'id' : 'date_coherency',
......@@ -51,7 +50,6 @@ class TradeConditionConstraint:
'description' : 'Version must be defined',
'type' : 'PropertyExistence',
'version' : None,
'message_property_not_set': 'Version must be defined',
'message_no_such_property' : 'Version must be defined',
},
)
......@@ -35,7 +35,6 @@ class TradeModelLineConstraint:
'description' : 'Property reference must be defined',
'type' : 'PropertyExistence',
'reference' : None,
"message_property_not_set" : 'Reference must be defined in lines',
"message_no_such_property" : 'Reference must be defined in lines'
},
{ 'id' : 'resource',
......
......@@ -86,7 +86,6 @@ class TradeOrder:
'type' : 'PropertyExistence',
'start_date' : 1,
'message_no_such_property' : "Shipping Date must be defined",
'message_property_not_set' : "Shipping Date must be defined",
},
{ 'id' : 'date_coherency',
'description' : 'Stop Date must be after Start Date',
......
......@@ -45,11 +45,13 @@ class PropertyExistence(Constraint):
"""
_message_id_list = ['message_no_such_property',
# Only keeping this message for backward-compatibility
# as it was meaningless to call a getProperty() after
# hasProperty() failed
'message_property_not_set']
message_no_such_property = "Property existence error for property "\
"${property_id}, this document has no such property"
message_property_not_set = "Property existence error for property "\
"${property_id}, this property is not defined"
"${property_id}, this document has no such property or the "\
"property has never been set"
def _checkConsistency(self, obj, fixit=0):
"""Check the object's consistency.
......@@ -61,10 +63,6 @@ class PropertyExistence(Constraint):
mapping = dict(property_id=property_id)
if not obj.hasProperty(property_id):
error_message_id = "message_no_such_property"
elif obj.getProperty(property_id) is None:
# If value is '', attribute is considered a defined
# XXX is this the default API ?
error_message_id = "message_property_not_set"
else:
error_message_id = None
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment