fix default setting to not change current behaviour

This commit is contained in:
Matthias 2021-10-13 17:40:50 +02:00
parent 0742fb063c
commit 147d2d4631
No known key found for this signature in database
GPG Key ID: F50EF5741D33E076
2 changed files with 4 additions and 4 deletions

View File

@ -726,8 +726,8 @@ class InvenTreeSetting(BaseInvenTreeSetting):
'PART_NAME_FORMAT': {
'name': _('Part Name Display Format'),
'description': _('Format to display the part name'),
'default': "{{ part.IPN if part.IPN }} {{ '|' if part.IPN }} {{ part.name }} {{ '|' if part.revision }}"
" {{ part.revision }}",
'default': "{{ part.IPN if part.IPN }}{{ ' | ' if part.IPN }}{{ part.name }}{{ ' | ' if part.revision }}"
"{{ part.revision if part.revision }}",
'validator': validate_part_name_format
},

View File

@ -144,8 +144,8 @@ class SettingsViewTest(TestCase):
setting = InvenTreeSetting.get_setting_object('PART_NAME_FORMAT')
# test default value
self.assertEqual(setting.value, "{{ part.IPN if part.IPN }} {{ '|' if part.IPN }} {{ part.name }} "
"{{ '|' if part.revision }} {{ part.revision }}")
self.assertEqual(setting.value, "{{ part.IPN if part.IPN }}{{ ' | ' if part.IPN }}{{ part.name }}"
"{{ ' | ' if part.revision }}{{ part.revision if part.revision }}")
url = self.get_url(setting.pk)