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
master allow_login_change allow_login_change_wip arnau arnau-TM-components-products-migration arnau-TM-isBuildable-with-multiple-BusinessLinks arnau-TM-jabber-client-desktop-notifications arnau-kns arnau-kns-without-property-mapping arnau-merge arnau-poc arnau-real-time-inventory-accounting auto_extend_select_list autoflake backup_erp5_workflow bk_erp5ish_actions_tool bk_sqlcatalog boc-interaction-drop bryton/py3 bt5_config cache callable-jupyter-storage catalog_filter catalog_fulltext catalog_fulltext_old cedric cedriclen cedriclen-eos certificate_authority cherry-pick-243c2f03 cherry-pick-304d7a28 cherry-pick-4a8e045d cleanJSByJSLint clean_up_upgrader cleanup_acquisition_base_category compact_title_no_reference credential_update_action datetimefield deferred_listbox delivery_item_barcode douglas_forum dream_distributor dsn-phase3 eos-dev erp5-component erp5-forum erp5-messenger erp5-preference erp5-release erp5-slapos-upgrade erp5-util-testing erp5-vifib erp5-vifib-cleanup erp5_calendar erp5_capture_flag erp5_catalog erp5_catalog_final erp5_corporate_identity erp5_discussion_tool erp5_forum erp5_free_subscription erp5_hal_json_style_fix_restricted_access_with_traverse erp5_monitoring_app erp5_new_officejs erp5_new_officejs_2 erp5_new_officejs_3 erp5_new_officejs_4 erp5_new_officejs_5 erp5_officejs erp5_payslip_migration erp5_texteditor_migration erp5_workflow erp5testnode_max_timeout experiment/coding_style_test_suite feat/olapy feat/pdm_content_translation feature/accounting-reports-stats feature/hal-actions-support feature/hal-support-update feature/jio-accounting-reports feature/jio-action-accounting feature/jio-selection-actions feature/json-allows-all-jio-actions feature/renderjs-matrixbox feature/renderjs-ui-no-header feature/rjs-listbox-stats feature/rjs-mass-transition feature/rjs-print-action fix/20180928-1D89375 fix/consistency_check_alarm fix/login_validate_check_consistency fix/multiple_small_fixes_to_zodb_history_tab fix/support-request-app-empty fix_listbox_buttons fix_system_processes_ownership for_testrunner_1 for_testrunner_2 for_testrunner_3 gabriel gabriel-fix-rounding-in-accounting-generation gabriel-fix-rounding-in-accounting-generation2 gadget-json-value hateoas hotfix/accounting-test-timeout hotfix/callable_tool hotfix/field-keeps-request hotfix/jio-mass-transition hotfix/jio_view hotfix/pdm-test hotfix/rjs-accounting-tests hotfix/rjs-editability hotfix/rjs-form-less-invasive hotfix/rjs-formfields-padding hotfix/rjs-listbox-mutex hotfix/rjs-replace-query-with-uids hotfix/tests-cleanup http_cache_fix improve_default_caching_policy_manager initsite interaction-drop isDeletable item_tracking_graph_editor ivan jerome-bt-reference-doc jerome_graph_editor_renderjs jerome_new_style_solve_divergence jerome_user_preference_time_zone jio jm/form-action-guard joblib-activity js-ui kns kns-kr lazy_simulation_causality lignan lingnan listbox-generator listbox_url macros_fix mame mame-bt5-cleanup mame-erp5_project-cleanup mame-naming-convention mame-naming-convention-list_method mame-test-stock-indexation mame-work mame2 maste_copy master-erp5-test-result-scalability master-erp5-test-result-scalability-rebase master-test-fix-additionalbt5path master_calendar_wip_patches master_calendar_wip_patches_extend_security master_no_guard_on_workflow_transition master_no_guard_on_workflow_transition_plus_calendar_wip_patchs mic_wind mmariani-inventory monitoring monitoring-graph mrp new-render-presentation no_longer_simulated_state notebook_roque officejs officejs_clean officejs_monitoring officejs_zip ojs_wip old_erp5_text_editor_migration pere portal_callables portal_solver_process_security_configuration presentation project_nexedi_net rebased_mrp refactor/base_edit refactor/renderjs reindex_calendar_after_change_calendar_exception reverse_logistics revert-38554dbe revert-6c89fe9b rewrite_test_21_AcquiredPortalType romain-fulltext romain_monitoring_app roque_appstore_base roque_appstore_improvements roque_credentials roque_dev roque_drone_simulator roque_erp5 roque_fix_coordinates roque_officejs roque_quick scalability-master scalability-master2 scalability-master2-rebase scalability-roque scalability-roque-2 scalability-run-command shop-box sms_more_than_140_characters strict_catalog syncml taskdistribution-xmlrpc-binary test_page testnode_software_link timezones tmp/getInstalledBusinessTemplate_never_installed_bt tristan tristan-merge tristan-performance ttrm upgradeSite view-aggregated-amounts vivekpab_renderjs_interfaces w3validator_removal wenjie wenjie_branch wip yryr yryr-components-cp yryr-inventory-cache yryr-test yryr-with-components yusei test-ui test-rjsacc test-rjs renderjs-test erp5.util-0.4.56 erp5.util-0.4.55 erp5.util-0.4.54 erp5.util-0.4.53 erp5.util-0.4.52 erp5.util-0.4.49 erp5.util-0.4.46 erp5.util-0.4.44 erp5.util-0.4.43 erp5.util-0.4.41 erp5.util-0.4.40 erp5.util-0.4.37 erp5.util-0.4.1 erp5.util-0.4 erp5.util-0.3 erp5.util-0.2 erp5.util-0.1
No related merge requests found
......@@ -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