Skip to content

Commit

Permalink
Fix: do not bump version, fix render_fields.html formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mutantsan committed Apr 16, 2024
1 parent 54bf426 commit 507efcd
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
48 changes: 24 additions & 24 deletions ckanext/scheming/templates/scheming/snippets/render_fields.html
Original file line number Diff line number Diff line change
@@ -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 %}
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import setup, find_packages

version = '3.0.1'
version = '3.0.0'

setup(
name='ckanext-scheming',
Expand Down

0 comments on commit 507efcd

Please sign in to comment.