- context.document_edit_control(text=form.get('text'), text_format='html') and \
- context.setRedirect(context, 'object/view', **{'ajax':ajax}):
- return
+ context.document_edit_control(text=form.get('text'), text_format='html') :
+ attachments.removeUnusedAttachments(context.EditableBody())
+ return context.setRedirect(context, 'object/view', **{'ajax':ajax})