def show_object_form(object, action, previous_object=None, should_upgrade_schema=False, placeholder_data=None):
    if ((object is None) and (previous_object is None)):
        data = generate_placeholder(action.schema)
        if placeholder_data:
            for (path, value) in placeholder_data.items():
                try:
                    sub_data = data
                    for step in path[:(- 1)]:
                        sub_data = sub_data[step]
                    sub_data[path[(- 1)]] = value
                except Exception:
                    pass
    elif ((object is None) and (previous_object is not None)):
        data = logic.schemas.copy_data(previous_object.data, previous_object.schema)
    else:
        data = object.data
    previous_object_schema = None
    mode = 'edit'
    if should_upgrade_schema:
        mode = 'upgrade'
        assert (object is not None)
        schema = action.schema
        (data, upgrade_warnings) = logic.schemas.convert_to_schema(object.data, object.schema, action.schema)
        for upgrade_warning in upgrade_warnings:
            flask.flash(upgrade_warning, 'warning')
    elif (object is not None):
        schema = object.schema
    elif (previous_object is not None):
        schema = previous_object.schema
        previous_object_schema = schema
    else:
        schema = action.schema
    if ((action is not None) and (action.instrument is not None) and (flask_login.current_user in action.instrument.responsible_users)):
        may_create_log_entry = True
        create_log_entry_default = action.instrument.create_log_entry_default
        instrument_log_categories = logic.instrument_log_entries.get_instrument_log_categories(action.instrument.id)
        if ('create_instrument_log_entry' in flask.request.form):
            category_ids = []
            for category_id in flask.request.form.getlist('instrument_log_categories'):
                try:
                    if (int(category_id) in [category.id for category in instrument_log_categories]):
                        category_ids.append(int(category_id))
                except Exception:
                    pass
        else:
            category_ids = None
    else:
        instrument_log_categories = None
        category_ids = None
        create_log_entry_default = None
        may_create_log_entry = False
    permissions_for_group_id = None
    permissions_for_project_id = None
    copy_permissions_object_id = None
    if (object is None):
        if ((flask.request.form.get('permissions_method') == 'copy_permissions') and flask.request.form.get('copy_permissions_object_id')):
            copy_permissions_object_id = flask.request.form.get('copy_permissions_object_id')
            try:
                copy_permissions_object_id = int(copy_permissions_object_id)
                if (Permissions.READ not in get_user_object_permissions(copy_permissions_object_id, flask_login.current_user.id)):
                    flask.flash(_('Unable to copy permissions. Default permissions will be applied.'), 'error')
                    copy_permissions_object_id = None
            except Exception:
                flask.flash(_('Unable to copy permissions. Default permissions will be applied.'), 'error')
                copy_permissions_object_id = None
        elif ((flask.request.form.get('permissions_method') == 'permissions_for_group') and flask.request.form.get('permissions_for_group_group_id')):
            permissions_for_group_id = flask.request.form.get('permissions_for_group_group_id')
            try:
                permissions_for_group_id = int(permissions_for_group_id)
                if (flask_login.current_user.id not in logic.groups.get_group_member_ids(permissions_for_group_id)):
                    flask.flash(_('Unable to grant permissions to basic group. Default permissions will be applied.'), 'error')
                    permissions_for_group_id = None
            except Exception:
                flask.flash(_('Unable to grant permissions to basic group. Default permissions will be applied.'), 'error')
                permissions_for_group_id = None
        elif ((flask.request.form.get('permissions_method') == 'permissions_for_project') and flask.request.form.get('permissions_for_project_project_id')):
            permissions_for_project_id = flask.request.form.get('permissions_for_project_project_id')
            try:
                permissions_for_project_id = int(permissions_for_project_id)
                if (flask_login.current_user.id not in logic.projects.get_project_member_user_ids_and_permissions(permissions_for_project_id, include_groups=True)):
                    flask.flash(_('Unable to grant permissions to project group. Default permissions will be applied.'), 'error')
                    permissions_for_project_id = None
            except Exception:
                flask.flash(_('Unable to grant permissions to project group. Default permissions will be applied.'), 'error')
                permissions_for_project_id = None
    if (previous_object is not None):
        action_id = previous_object.action_id
        previous_object_id = previous_object.id
        has_grant_for_previous_object = (Permissions.GRANT in get_user_object_permissions(user_id=flask_login.current_user.id, object_id=previous_object_id))
    else:
        action_id = action.id
        previous_object_id = None
        has_grant_for_previous_object = False
    errors = []
    object_errors = {}
    form_data = {}
    previous_actions = []
    serializer = itsdangerous.URLSafeSerializer(flask.current_app.config['SECRET_KEY'])
    form = ObjectForm()
    if ((flask.request.method != 'GET') and form.validate_on_submit()):
        raw_form_data = {key: flask.request.form.getlist(key) for key in flask.request.form}
        form_data = {k: v[0] for (k, v) in raw_form_data.items()}
        if ('input_num_batch_objects' in form_data):
            try:
                num_objects_in_batch = int(form_data['input_num_batch_objects'])
            except ValueError:
                try:
                    num_objects_in_batch = float(form_data['input_num_batch_objects'])
                    if (num_objects_in_batch == int(num_objects_in_batch)):
                        num_objects_in_batch = int(num_objects_in_batch)
                    else:
                        raise
                except ValueError:
                    errors.append('input_num_batch_objects')
                    num_objects_in_batch = None
                else:
                    form_data['input_num_batch_objects'] = str(num_objects_in_batch)
            else:
                form_data['input_num_batch_objects'] = str(num_objects_in_batch)
        else:
            num_objects_in_batch = None
        if ('previous_actions' in flask.request.form):
            try:
                previous_actions = serializer.loads(flask.request.form['previous_actions'])
            except itsdangerous.BadData:
                flask.abort(400)
        if ('action_submit' in form_data):
            if (schema.get('batch', False) and (num_objects_in_batch is not None)):
                name_suffix_format = schema.get('batch_name_format', '{:d}')
                try:
                    name_suffix_format.format(1)
                except (ValueError, KeyError):
                    name_suffix_format = '{:d}'
                if name_suffix_format:
                    example_name_suffix = name_suffix_format.format(1)
                else:
                    example_name_suffix = ''
                if ('object__name__text' in form_data):
                    batch_base_name = form_data['object__name__text']
                    raw_form_data['object__name__text'] = [(batch_base_name + example_name_suffix)]
                else:
                    enabled_languages = form_data.get('object__name__text_languages', [])
                    if ('en' not in enabled_languages):
                        enabled_languages.append('en')
                    for language_code in enabled_languages:
                        batch_base_name = form_data.get(('object__name__text_' + language_code), '')
                        raw_form_data[('object__name__text_' + language_code)] = [(batch_base_name + example_name_suffix)]
            else:
                batch_base_name = None
                name_suffix_format = None
            (object_data, object_errors) = parse_form_data(raw_form_data, schema)
            errors += object_errors
            if ((object_data is not None) and (not errors)):
                try:
                    validate(object_data, schema)
                except ValidationError:
                    print('object schema validation failed')
                    flask.abort(400)
                for markdown in logic.markdown_to_html.get_markdown_from_object_data(object_data):
                    markdown_as_html = logic.markdown_to_html.markdown_to_safe_html(markdown)
                    logic.markdown_images.mark_referenced_markdown_images_as_permanent(markdown_as_html)
                if (object is None):
                    if (schema.get('batch', False) and (num_objects_in_batch is not None)):
                        if (('name' in object_data) and ('text' in object_data['name']) and (name_suffix_format is not None) and (batch_base_name is not None)):
                            data_sequence = []
                            for i in range(1, (num_objects_in_batch + 1)):
                                if name_suffix_format:
                                    name_suffix = name_suffix_format.format(i)
                                else:
                                    name_suffix = ''
                                object_data['name']['text'] = (batch_base_name + name_suffix)
                                data_sequence.append(deepcopy(object_data))
                        else:
                            data_sequence = ([object_data] * num_objects_in_batch)
                        objects = create_object_batch(action_id=action.id, data_sequence=data_sequence, user_id=flask_login.current_user.id, copy_permissions_object_id=copy_permissions_object_id, permissions_for_group_id=permissions_for_group_id, permissions_for_project_id=permissions_for_project_id)
                        object_ids = [object.id for object in objects]
                        if (category_ids is not None):
                            log_entry = logic.instrument_log_entries.create_instrument_log_entry(instrument_id=action.instrument.id, user_id=flask_login.current_user.id, content='', category_ids=category_ids)
                            for object_id in object_ids:
                                logic.instrument_log_entries.create_instrument_log_object_attachment(instrument_log_entry_id=log_entry.id, object_id=object_id)
                        flask.flash(_('The objects were created successfully.'), 'success')
                        return flask.redirect(flask.url_for('.objects', ids=','.join([str(object_id) for object_id in object_ids])))
                    else:
                        object = create_object(action_id=action.id, data=object_data, user_id=flask_login.current_user.id, previous_object_id=previous_object_id, schema=previous_object_schema, copy_permissions_object_id=copy_permissions_object_id, permissions_for_group_id=permissions_for_group_id, permissions_for_project_id=permissions_for_project_id)
                        if (category_ids is not None):
                            log_entry = logic.instrument_log_entries.create_instrument_log_entry(instrument_id=action.instrument.id, user_id=flask_login.current_user.id, content='', category_ids=category_ids)
                            logic.instrument_log_entries.create_instrument_log_object_attachment(instrument_log_entry_id=log_entry.id, object_id=object.id)
                        flask.flash(_('The object was created successfully.'), 'success')
                else:
                    if ((object_data != object.data) or (schema != object.schema)):
                        update_object(object_id=object.id, user_id=flask_login.current_user.id, data=object_data, schema=schema)
                    flask.flash(_('The object was updated successfully.'), 'success')
                return flask.redirect(flask.url_for('.object', object_id=object.id))
        elif any(((name.startswith('action_object__') and (name.endswith('__delete') or name.endswith('__add') or name.endswith('__addcolumn') or name.endswith('__deletecolumn'))) for name in form_data)):
            action = [name for name in form_data if name.startswith('action_')][0]
            previous_actions.append(action)
    if previous_actions:
        try:
            for action in previous_actions:
                apply_action_to_data(action, data, schema)
            form_data = apply_action_to_form_data(previous_actions[(- 1)], form_data)
        except ValueError:
            flask.abort(400)
    if (not flask.current_app.config['LOAD_OBJECTS_IN_BACKGROUND']):
        referencable_objects = get_objects_with_permissions(user_id=flask_login.current_user.id, permissions=Permissions.READ)
        if (object is not None):
            referencable_objects = [referencable_object for referencable_object in referencable_objects if (referencable_object.object_id != object.object_id)]
    else:
        referencable_objects = []
        existing_objects = []
    sorted_actions = get_sorted_actions_for_user(user_id=flask_login.current_user.id)
    action_type_id_by_action_id = {}
    for action_type in get_action_types():
        for action in get_actions(action_type.id):
            action_type_id_by_action_id[action.id] = action_type.id
    tags = [{'name': tag.name, 'uses': tag.uses} for tag in logic.tags.get_tags()]
    users = get_users(exclude_hidden=True)
    users.sort(key=(lambda user: user.id))
    english = get_language(Language.ENGLISH)
    if (object is None):
        if (not flask.current_app.config['LOAD_OBJECTS_IN_BACKGROUND']):
            existing_objects = get_objects_with_permissions(user_id=flask_login.current_user.id, permissions=Permissions.GRANT)
        user_groups = logic.groups.get_user_groups(flask_login.current_user.id)
        user_projects = logic.projects.get_user_projects(flask_login.current_user.id, include_groups=True)
        return flask.render_template('objects/forms/form_create.html', action_id=action_id, schema=schema, data=data, errors=errors, object_errors=object_errors, form_data=form_data, previous_actions=serializer.dumps(previous_actions), form=form, can_copy_permissions=True, existing_objects=existing_objects, user_groups=user_groups, user_projects=user_projects, referencable_objects=referencable_objects, sorted_actions=sorted_actions, action_type_id_by_action_id=action_type_id_by_action_id, get_object_if_current_user_has_read_permissions=get_object_if_current_user_has_read_permissions, ActionType=models.ActionType, datetime=datetime, tags=tags, users=users, may_create_log_entry=may_create_log_entry, instrument_log_categories=instrument_log_categories, create_log_entry_default=create_log_entry_default, previous_object_id=previous_object_id, has_grant_for_previous_object=has_grant_for_previous_object, languages=get_languages(only_enabled_for_input=True), ENGLISH=english)
    else:
        return flask.render_template('objects/forms/form_edit.html', schema=schema, data=data, object_id=object.object_id, errors=errors, object_errors=object_errors, form_data=form_data, previous_actions=serializer.dumps(previous_actions), form=form, referencable_objects=referencable_objects, sorted_actions=sorted_actions, get_object_if_current_user_has_read_permissions=get_object_if_current_user_has_read_permissions, action_type_id_by_action_id=action_type_id_by_action_id, ActionType=models.ActionType, datetime=datetime, tags=tags, users=users, mode=mode, languages=get_languages(), ENGLISH=english)
def show_object_form(object, action, previous_object=None, should_upgrade_schema=False, placeholder_data=None):
    if ((object is None) and (previous_object is None)):
        data = generate_placeholder(action.schema)
        if placeholder_data:
            for (path, value) in placeholder_data.items():
                try:
                    sub_data = data
                    for step in path[:(- 1)]:
                        sub_data = sub_data[step]
                    sub_data[path[(- 1)]] = value
                except Exception:
                    pass
    elif ((object is None) and (previous_object is not None)):
        data = logic.schemas.copy_data(previous_object.data, previous_object.schema)
    else:
        data = object.data
    previous_object_schema = None
    mode = 'edit'
    if should_upgrade_schema:
        mode = 'upgrade'
        assert (object is not None)
        schema = action.schema
        (data, upgrade_warnings) = logic.schemas.convert_to_schema(object.data, object.schema, action.schema)
        for upgrade_warning in upgrade_warnings:
            flask.flash(upgrade_warning, 'warning')
    elif (object is not None):
        schema = object.schema
    elif (previous_object is not None):
        schema = previous_object.schema
        previous_object_schema = schema
    else:
        schema = action.schema
    if ((action is not None) and (action.instrument is not None) and (flask_login.current_user in action.instrument.responsible_users)):
        may_create_log_entry = True
        create_log_entry_default = action.instrument.create_log_entry_default
        instrument_log_categories = logic.instrument_log_entries.get_instrument_log_categories(action.instrument.id)
        if ('create_instrument_log_entry' in flask.request.form):
            category_ids = []
            for category_id in flask.request.form.getlist('instrument_log_categories'):
                try:
                    if (int(category_id) in [category.id for category in instrument_log_categories]):
                        category_ids.append(int(category_id))
                except Exception:
                    pass
        else:
            category_ids = None
    else:
        instrument_log_categories = None
        category_ids = None
        create_log_entry_default = None
        may_create_log_entry = False
    permissions_for_group_id = None
    permissions_for_project_id = None
    copy_permissions_object_id = None
    if (object is None):
        if ((flask.request.form.get('permissions_method') == 'copy_permissions') and flask.request.form.get('copy_permissions_object_id')):
            copy_permissions_object_id = flask.request.form.get('copy_permissions_object_id')
            try:
                copy_permissions_object_id = int(copy_permissions_object_id)
                if (Permissions.READ not in get_user_object_permissions(copy_permissions_object_id, flask_login.current_user.id)):
                    flask.flash(_('Unable to copy permissions. Default permissions will be applied.'), 'error')
                    copy_permissions_object_id = None
            except Exception:
                flask.flash(_('Unable to copy permissions. Default permissions will be applied.'), 'error')
                copy_permissions_object_id = None
        elif ((flask.request.form.get('permissions_method') == 'permissions_for_group') and flask.request.form.get('permissions_for_group_group_id')):
            permissions_for_group_id = flask.request.form.get('permissions_for_group_group_id')
            try:
                permissions_for_group_id = int(permissions_for_group_id)
                if (flask_login.current_user.id not in logic.groups.get_group_member_ids(permissions_for_group_id)):
                    flask.flash(_('Unable to grant permissions to basic group. Default permissions will be applied.'), 'error')
                    permissions_for_group_id = None
            except Exception:
                flask.flash(_('Unable to grant permissions to basic group. Default permissions will be applied.'), 'error')
                permissions_for_group_id = None
        elif ((flask.request.form.get('permissions_method') == 'permissions_for_project') and flask.request.form.get('permissions_for_project_project_id')):
            permissions_for_project_id = flask.request.form.get('permissions_for_project_project_id')
            try:
                permissions_for_project_id = int(permissions_for_project_id)
                if (flask_login.current_user.id not in logic.projects.get_project_member_user_ids_and_permissions(permissions_for_project_id, include_groups=True)):
                    flask.flash(_('Unable to grant permissions to project group. Default permissions will be applied.'), 'error')
                    permissions_for_project_id = None
            except Exception:
                flask.flash(_('Unable to grant permissions to project group. Default permissions will be applied.'), 'error')
                permissions_for_project_id = None
    if (previous_object is not None):
        action_id = previous_object.action_id
        previous_object_id = previous_object.id
        has_grant_for_previous_object = (Permissions.GRANT in get_user_object_permissions(user_id=flask_login.current_user.id, object_id=previous_object_id))
    else:
        action_id = action.id
        previous_object_id = None
        has_grant_for_previous_object = False
    errors = []
    object_errors = {}
    form_data = {}
    previous_actions = []
    serializer = itsdangerous.URLSafeSerializer(flask.current_app.config['SECRET_KEY'])
    form = ObjectForm()
    if ((flask.request.method != 'GET') and form.validate_on_submit()):
        raw_form_data = {key: flask.request.form.getlist(key) for key in flask.request.form}
        form_data = {k: v[0] for (k, v) in raw_form_data.items()}
        if ('input_num_batch_objects' in form_data):
            try:
                num_objects_in_batch = int(form_data['input_num_batch_objects'])
            except ValueError:
                try:
                    num_objects_in_batch = float(form_data['input_num_batch_objects'])
                    if (num_objects_in_batch == int(num_objects_in_batch)):
                        num_objects_in_batch = int(num_objects_in_batch)
                    else:
                        raise
                except ValueError:
                    errors.append('input_num_batch_objects')
                    num_objects_in_batch = None
                else:
                    form_data['input_num_batch_objects'] = str(num_objects_in_batch)
            else:
                form_data['input_num_batch_objects'] = str(num_objects_in_batch)
        else:
            num_objects_in_batch = None
        if ('previous_actions' in flask.request.form):
            try:
                previous_actions = serializer.loads(flask.request.form['previous_actions'])
            except itsdangerous.BadData:
                flask.abort(400)
        if ('action_submit' in form_data):
            if (schema.get('batch', False) and (num_objects_in_batch is not None)):
                name_suffix_format = schema.get('batch_name_format', '{:d}')
                try:
                    name_suffix_format.format(1)
                except (ValueError, KeyError):
                    name_suffix_format = '{:d}'
                if name_suffix_format:
                    example_name_suffix = name_suffix_format.format(1)
                else:
                    example_name_suffix = 
                if ('object__name__text' in form_data):
                    batch_base_name = form_data['object__name__text']
                    raw_form_data['object__name__text'] = [(batch_base_name + example_name_suffix)]
                else:
                    enabled_languages = form_data.get('object__name__text_languages', [])
                    if ('en' not in enabled_languages):
                        enabled_languages.append('en')
                    for language_code in enabled_languages:
                        batch_base_name = form_data.get(('object__name__text_' + language_code), )
                        raw_form_data[('object__name__text_' + language_code)] = [(batch_base_name + example_name_suffix)]
            else:
                batch_base_name = None
                name_suffix_format = None
            (object_data, object_errors) = parse_form_data(raw_form_data, schema)
            errors += object_errors
            if ((object_data is not None) and (not errors)):
                try:
                    validate(object_data, schema)
                except ValidationError:
                    print('object schema validation failed')
                    flask.abort(400)
                for markdown in logic.markdown_to_html.get_markdown_from_object_data(object_data):
                    markdown_as_html = logic.markdown_to_html.markdown_to_safe_html(markdown)
                    logic.markdown_images.mark_referenced_markdown_images_as_permanent(markdown_as_html)
                if (object is None):
                    if (schema.get('batch', False) and (num_objects_in_batch is not None)):
                        if (('name' in object_data) and ('text' in object_data['name']) and (name_suffix_format is not None) and (batch_base_name is not None)):
                            data_sequence = []
                            for i in range(1, (num_objects_in_batch + 1)):
                                if name_suffix_format:
                                    name_suffix = name_suffix_format.format(i)
                                else:
                                    name_suffix = 
                                object_data['name']['text'] = (batch_base_name + name_suffix)
                                data_sequence.append(deepcopy(object_data))
                        else:
                            data_sequence = ([object_data] * num_objects_in_batch)
                        objects = create_object_batch(action_id=action.id, data_sequence=data_sequence, user_id=flask_login.current_user.id, copy_permissions_object_id=copy_permissions_object_id, permissions_for_group_id=permissions_for_group_id, permissions_for_project_id=permissions_for_project_id)
                        object_ids = [object.id for object in objects]
                        if (category_ids is not None):
                            log_entry = logic.instrument_log_entries.create_instrument_log_entry(instrument_id=action.instrument.id, user_id=flask_login.current_user.id, content=, category_ids=category_ids)
                            for object_id in object_ids:
                                logic.instrument_log_entries.create_instrument_log_object_attachment(instrument_log_entry_id=log_entry.id, object_id=object_id)
                        flask.flash(_('The objects were created successfully.'), 'success')
                        return flask.redirect(flask.url_for('.objects', ids=','.join([str(object_id) for object_id in object_ids])))
                    else:
                        object = create_object(action_id=action.id, data=object_data, user_id=flask_login.current_user.id, previous_object_id=previous_object_id, schema=previous_object_schema, copy_permissions_object_id=copy_permissions_object_id, permissions_for_group_id=permissions_for_group_id, permissions_for_project_id=permissions_for_project_id)
                        if (category_ids is not None):
                            log_entry = logic.instrument_log_entries.create_instrument_log_entry(instrument_id=action.instrument.id, user_id=flask_login.current_user.id, content=, category_ids=category_ids)
                            logic.instrument_log_entries.create_instrument_log_object_attachment(instrument_log_entry_id=log_entry.id, object_id=object.id)
                        flask.flash(_('The object was created successfully.'), 'success')
                else:
                    if ((object_data != object.data) or (schema != object.schema)):
                        update_object(object_id=object.id, user_id=flask_login.current_user.id, data=object_data, schema=schema)
                    flask.flash(_('The object was updated successfully.'), 'success')
                return flask.redirect(flask.url_for('.object', object_id=object.id))
        elif any(((name.startswith('action_object__') and (name.endswith('__delete') or name.endswith('__add') or name.endswith('__addcolumn') or name.endswith('__deletecolumn'))) for name in form_data)):
            action = [name for name in form_data if name.startswith('action_')][0]
            previous_actions.append(action)
    if previous_actions:
        try:
            for action in previous_actions:
                apply_action_to_data(action, data, schema)
            form_data = apply_action_to_form_data(previous_actions[(- 1)], form_data)
        except ValueError:
            flask.abort(400)
    if (not flask.current_app.config['LOAD_OBJECTS_IN_BACKGROUND']):
        referencable_objects = get_objects_with_permissions(user_id=flask_login.current_user.id, permissions=Permissions.READ)
        if (object is not None):
            referencable_objects = [referencable_object for referencable_object in referencable_objects if (referencable_object.object_id != object.object_id)]
    else:
        referencable_objects = []
        existing_objects = []
    sorted_actions = get_sorted_actions_for_user(user_id=flask_login.current_user.id)
    action_type_id_by_action_id = {}
    for action_type in get_action_types():
        for action in get_actions(action_type.id):
            action_type_id_by_action_id[action.id] = action_type.id
    tags = [{'name': tag.name, 'uses': tag.uses} for tag in logic.tags.get_tags()]
    users = get_users(exclude_hidden=True)
    users.sort(key=(lambda user: user.id))
    english = get_language(Language.ENGLISH)
    if (object is None):
        if (not flask.current_app.config['LOAD_OBJECTS_IN_BACKGROUND']):
            existing_objects = get_objects_with_permissions(user_id=flask_login.current_user.id, permissions=Permissions.GRANT)
        user_groups = logic.groups.get_user_groups(flask_login.current_user.id)
        user_projects = logic.projects.get_user_projects(flask_login.current_user.id, include_groups=True)
        return flask.render_template('objects/forms/form_create.html', action_id=action_id, schema=schema, data=data, errors=errors, object_errors=object_errors, form_data=form_data, previous_actions=serializer.dumps(previous_actions), form=form, can_copy_permissions=True, existing_objects=existing_objects, user_groups=user_groups, user_projects=user_projects, referencable_objects=referencable_objects, sorted_actions=sorted_actions, action_type_id_by_action_id=action_type_id_by_action_id, get_object_if_current_user_has_read_permissions=get_object_if_current_user_has_read_permissions, ActionType=models.ActionType, datetime=datetime, tags=tags, users=users, may_create_log_entry=may_create_log_entry, instrument_log_categories=instrument_log_categories, create_log_entry_default=create_log_entry_default, previous_object_id=previous_object_id, has_grant_for_previous_object=has_grant_for_previous_object, languages=get_languages(only_enabled_for_input=True), ENGLISH=english)
    else:
        return flask.render_template('objects/forms/form_edit.html', schema=schema, data=data, object_id=object.object_id, errors=errors, object_errors=object_errors, form_data=form_data, previous_actions=serializer.dumps(previous_actions), form=form, referencable_objects=referencable_objects, sorted_actions=sorted_actions, get_object_if_current_user_has_read_permissions=get_object_if_current_user_has_read_permissions, action_type_id_by_action_id=action_type_id_by_action_id, ActionType=models.ActionType, datetime=datetime, tags=tags, users=users, mode=mode, languages=get_languages(), ENGLISH=english)