Skip to content

Commit

Permalink
Closes #6338: Decimal fields are no longer coerced to strings in REST…
Browse files Browse the repository at this point in the history
… API
  • Loading branch information
jeremystretch committed May 10, 2021
1 parent f3abf84 commit f6823b5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/release-notes/version-2.12.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

* [#5532](https://github.com/netbox-community/netbox/issues/5532) - Drop support for Python 3.6
* [#5994](https://github.com/netbox-community/netbox/issues/5994) - Drop support for `display_field` argument on ObjectVar
* [#6338](https://github.com/netbox-community/netbox/issues/6338) - Decimal fields are no longer coerced to strings in REST API

### REST API Changes

Expand All @@ -22,9 +23,13 @@
* Removed the `display_name` attribute (use `display` instead)
* dcim.Rack
* Removed the `display_name` attribute (use `display` instead)
* dcim.Site
* `latitude` and `longitude` are now decimal fields rather than strings
* extras.ContentType
* Removed the `display_name` attribute (use `display` instead)
* ipam.VLAN
* Removed the `display_name` attribute (use `display` instead)
* ipam.VRF
* Removed the `display_name` attribute (use `display` instead)
* virtualization.VirtualMachine
* `vcpus` is now a decimal field rather than a string
1 change: 1 addition & 0 deletions netbox/netbox/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,7 @@ def _setting(name, default=None):
REST_FRAMEWORK_VERSION = VERSION.rsplit('.', 1)[0] # Use major.minor as API version
REST_FRAMEWORK = {
'ALLOWED_VERSIONS': [REST_FRAMEWORK_VERSION],
'COERCE_DECIMAL_TO_STRING': False,
'DEFAULT_AUTHENTICATION_CLASSES': (
'rest_framework.authentication.SessionAuthentication',
'netbox.api.authentication.TokenAuthentication',
Expand Down

0 comments on commit f6823b5

Please sign in to comment.