Commit ec7d3866 authored by Jérome Perrin's avatar Jérome Perrin

core: do not ignore ActivityPendingError in Base_edit

They should be caught earlier by field validator.
If an ActivityPendingError occurs, we don't want to "half-edit" the document.
parent 1e22f611
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
from the context update logic from the context update logic
""" """
from Products.Formulator.Errors import FormValidationError from Products.Formulator.Errors import FormValidationError
from Products.CMFActivity.Errors import ActivityPendingError
request=container.REQUEST request=container.REQUEST
portal = context.getPortalObject() portal = context.getPortalObject()
...@@ -215,11 +214,11 @@ encapsulated_editor_list = [] ...@@ -215,11 +214,11 @@ encapsulated_editor_list = []
MARKER = [] MARKER = []
message = Base_translateString("Data updated.") message = Base_translateString("Data updated.")
try:
# We process all the field in form and # We process all the field in form and
# we check if they are in the request, # we check if they are in the request,
# then we edit them # then we edit them
for field in form.get_fields(): for field in form.get_fields():
parseField(field) parseField(field)
## XXX We need to find a way not to use meta_type. ## XXX We need to find a way not to use meta_type.
...@@ -232,16 +231,14 @@ try: ...@@ -232,16 +231,14 @@ try:
elif(field_meta_type == 'MatrixBox'): elif(field_meta_type == 'MatrixBox'):
editMatrixBox(field, request.get(field.id)) editMatrixBox(field, request.get(field.id))
# Return parsed values # Return parsed values
if silent_mode: return (kw, encapsulated_editor_list), 'edit' if silent_mode: return (kw, encapsulated_editor_list), 'edit'
# Maybe we should build a list of objects we need # Maybe we should build a list of objects we need
# Update basic attributes # Update basic attributes
context.edit(REQUEST=request, edit_order=edit_order, **kw) context.edit(REQUEST=request, edit_order=edit_order, **kw)
for encapsulated_editor in encapsulated_editor_list: for encapsulated_editor in encapsulated_editor_list:
encapsulated_editor.edit(context) encapsulated_editor.edit(context)
except ActivityPendingError,e:
message = Base_translateString("%s" % e)
if message_only: if message_only:
return message return 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