Dont make default version change

This commit is contained in:
shamoon 2025-01-25 19:14:11 -08:00
parent 0b4b96f7ce
commit 012a553d28
3 changed files with 8 additions and 3 deletions

View File

@ -577,4 +577,7 @@ Initial API version.
#### Version 7
- The format of select type custom fields has changed to return the options
as an array of objects with `id` and `label` fields.
as an array of objects with `id` and `label` fields. When creating or
updating a custom field value of a document for a select type custom field,
the value should be the `id` of the option whereas previously was the index
of the option.

View File

@ -151,7 +151,6 @@ class TestCustomFieldsAPI(DirectoriesMixin, APITestCase):
def test_custom_field_select_unique_ids(self):
"""
GIVEN:
- Nothing
- Existing custom field
WHEN:
- API request to create custom field with select options without id
@ -172,6 +171,7 @@ class TestCustomFieldsAPI(DirectoriesMixin, APITestCase):
},
},
),
headers={"Accept": "application/json; version=7"},
content_type="application/json",
)
self.assertEqual(resp.status_code, status.HTTP_201_CREATED)
@ -197,6 +197,7 @@ class TestCustomFieldsAPI(DirectoriesMixin, APITestCase):
},
},
),
headers={"Accept": "application/json; version=7"},
content_type="application/json",
)
self.assertEqual(resp.status_code, status.HTTP_200_OK)
@ -560,6 +561,7 @@ class TestCustomFieldsAPI(DirectoriesMixin, APITestCase):
},
],
},
headers={"Accept": "application/json; version=7"},
format="json",
)

View File

@ -341,7 +341,7 @@ REST_FRAMEWORK = {
"rest_framework.authentication.SessionAuthentication",
],
"DEFAULT_VERSIONING_CLASS": "rest_framework.versioning.AcceptHeaderVersioning",
"DEFAULT_VERSION": "7",
"DEFAULT_VERSION": "1",
# Make sure these are ordered and that the most recent version appears
# last
"ALLOWED_VERSIONS": ["1", "2", "3", "4", "5", "6", "7"],