From 507efcd869d44ee53a86f4b380afa87266916dd1 Mon Sep 17 00:00:00 2001 From: mutantsan Date: Tue, 16 Apr 2024 16:14:40 +0300 Subject: [PATCH] Fix: do not bump version, fix render_fields.html formatting --- .../scheming/snippets/render_fields.html | 48 +++++++++---------- setup.py | 2 +- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/ckanext/scheming/templates/scheming/snippets/render_fields.html b/ckanext/scheming/templates/scheming/snippets/render_fields.html index 1cd331cb..8bf48f05 100644 --- a/ckanext/scheming/templates/scheming/snippets/render_fields.html +++ b/ckanext/scheming/templates/scheming/snippets/render_fields.html @@ -1,30 +1,30 @@ -{#} - fields - a list of scheming field dictionaries - data - form data fields - errors - A dict of errors for the fields - entity_type - entity type - object_type - object type - set_fields_defaults - flag to set the default field values +{# +fields - a list of scheming field dictionaries +data - form data fields +errors - A dict of errors for the fields +entity_type - entity type +object_type - object type +set_fields_defaults - flag to set the default field values {#} {% for field in fields if field.form_snippet is not none %} - {% if field.field_name not in data and set_fields_defaults %} - {# Set the field default value before rendering but only if - it doesn't already exist in data which would mean the form - has been submitted. #} - {% if field.default_jinja2 %} - {% do data.__setitem__(field.field_name, h.scheming_render_from_string(field.default_jinja2)) %} - {% elif field.default %} - {% do data.__setitem__(field.field_name, field.default) %} - {% endif %} + {% if field.field_name not in data and set_fields_defaults %} + {# Set the field default value before rendering but only if + it doesn't already exist in data which would mean the form + has been submitted. #} + {% if field.default_jinja2 %} + {% do data.__setitem__(field.field_name, h.scheming_render_from_string(field.default_jinja2)) %} + {% elif field.default %} + {% do data.__setitem__(field.field_name, field.default) %} {% endif %} + {% endif %} - {% snippet 'scheming/snippets/form_field.html', - field=field, - data=data, - errors=errors, - licenses=licenses, - entity_type=entity_type, - object_type=object_type - %} + {% snippet 'scheming/snippets/form_field.html', + field=field, + data=data, + errors=errors, + licenses=licenses, + entity_type=entity_type, + object_type=object_type + %} {% endfor %} diff --git a/setup.py b/setup.py index c52bebfa..dc633225 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -version = '3.0.1' +version = '3.0.0' setup( name='ckanext-scheming',