Commit 74945bd0 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_hal_json_style] Drop unused form_hash in dialog

parent 49dfc705
...@@ -120,14 +120,6 @@ try: ...@@ -120,14 +120,6 @@ try:
editable_mode = request.get('editable_mode', 1) editable_mode = request.get('editable_mode', 1)
request.set('editable_mode', 1) request.set('editable_mode', 1)
form_data = form.validate_all_to_request(request) form_data = form.validate_all_to_request(request)
# Notify the underlying script whether user did modifications
form_hash = form.hash_validated_data(form_data)
# Inject `has_changed` parameter to arguments
if "form_hash" in extra_param:
kw['has_changed'] = (form_hash != extra_param.get('form_hash'))
# update form_hash here so we do not rely on developer/Dialog Script
# to pass it correctly
extra_param["form_hash"] = form_hash
# Put extra_param into request so we can pass it behind developers back # Put extra_param into request so we can pass it behind developers back
# it is picked up at Base_renderForm so the developer does not need to # it is picked up at Base_renderForm so the developer does not need to
......
...@@ -2,13 +2,7 @@ from Products.ERP5Type.Log import log ...@@ -2,13 +2,7 @@ from Products.ERP5Type.Log import log
log("Folder method received dialog_id, form_id, uids and {!s}".format(kwargs.keys())) log("Folder method received dialog_id, form_id, uids and {!s}".format(kwargs.keys()))
if kwargs.get('has_changed', None) is None: message = "First submission."
message = "First submission."
else:
if kwargs['has_changed']:
message = "Data has changed."
else:
message = "Data the same."
if kwargs.get("update_method", ""): if kwargs.get("update_method", ""):
return context.Base_renderForm(dialog_id, message="Updated. " + message) return context.Base_renderForm(dialog_id, message="Updated. " + message)
......
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