def _update_form_ids(app, master_app, form_ids_by_xmlns): _attachments = master_app.get_attachments() app_source = app.to_json() app_source.pop('external_blobs') app_source['_attachments'] = _attachments updated_source = update_form_unique_ids(app_source, form_ids_by_xmlns) attachments = app_source.pop('_attachments') new_wrapped_app = wrap_app(updated_source) save = partial(new_wrapped_app.save, increment_version=False) return new_wrapped_app.save_attachments(attachments, save)
def _update_form_ids(app, master_app, id_map): _attachments = master_app.get_attachments() app_source = app.to_json() app_source.pop('external_blobs') app_source['_attachments'] = _attachments updated_source = update_form_unique_ids(app_source, id_map) attachments = app_source.pop('_attachments') new_wrapped_app = wrap_app(updated_source) save = partial(new_wrapped_app.save, increment_version=False) return new_wrapped_app.save_attachments(attachments, save)