mirror of
https://github.com/netbox-community/netbox.git
synced 2026-01-14 07:42:18 -06:00
Closes #17653: Add function to trim whitespaces in export templates via jinja environment settings (#19078)
* Create RenderMixin, and unify template_code rendering and exporting * Join migrations * Add DEFAULT_MIME_TE constant * Move RenderMixin to extras.models.mixins, Rename RenderMixin to RenderTemplateMixin * Add render_jinja2 to __all__ * Rename ConfigTemplateFilterForm rendering FieldSet * ConfigTemplate lint * Simplify ExportTemplate get_context * Fix table order, and add fields for translations * Update Serializers * Update forms, tables, graphQL, API * Add extra tests for ConfigTemplate and ExportTemplate * Documentation update * Fix typo * Misc cleanup * Clean up template layouts --------- Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
This commit is contained in:
committed by
GitHub
parent
3902cab925
commit
fbd6d8c7fc
@@ -755,6 +755,10 @@ class ConfigTemplateTest(APIViewTestCases.APIViewTestCase):
|
||||
{
|
||||
'name': 'Config Template 4',
|
||||
'template_code': 'Foo: {{ foo }}',
|
||||
'mime_type': 'text/plain',
|
||||
'file_name': 'output4',
|
||||
'file_extension': 'txt',
|
||||
'as_attachment': True,
|
||||
},
|
||||
{
|
||||
'name': 'Config Template 5',
|
||||
@@ -778,7 +782,7 @@ class ConfigTemplateTest(APIViewTestCases.APIViewTestCase):
|
||||
),
|
||||
ConfigTemplate(
|
||||
name='Config Template 2',
|
||||
template_code='Bar: {{ bar }}'
|
||||
template_code='Bar: {{ bar }}',
|
||||
),
|
||||
ConfigTemplate(
|
||||
name='Config Template 3',
|
||||
|
||||
Reference in New Issue
Block a user