diff --git a/InvenTree/common/models.py b/InvenTree/common/models.py index f0c7c05b5a..8ccbf99986 100644 --- a/InvenTree/common/models.py +++ b/InvenTree/common/models.py @@ -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 }, diff --git a/InvenTree/common/test_views.py b/InvenTree/common/test_views.py index 2c15f2e357..0f592e9bb3 100644 --- a/InvenTree/common/test_views.py +++ b/InvenTree/common/test_views.py @@ -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)