1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

2862 Commits

Author SHA1 Message Date
Jeremy Stretch
112aaea51f Updated changelog for #2400 2018-11-27 16:18:57 -05:00
Tatsushi Demachi
c3cdf8e97e Fix type mismatches in API view (#2429)
* Fix tags field to be shown as array in API view

`tags` field in serializers is defineded as `TagListSerializerField`.
It should be shown as an array value in API view but actually, it is a
simple string value.

This fixes it by introducing a new `FieldInspector` to handle
`TagListSerializerField` type field as an array. It doesn't affects any
other type fields.

* Fix SerializedPKRelatedField type API expression

A field definded as `SerializedPKRelatedField` should be shown as an
array of child serializer objects in a response value definition in API
view but it is shown as an array of primary key values (usually
`integer` type) of a child serializer.

This fixes it by introducing a new `FieldInspector` to handle the field.
It doesn't affect any other type fields.

* Fix request parameter representation in API view

In API view, representation of a parameter defined as a sub class of
`WritableNestedSerializer` should be vary between a request and a
response. For example, `tenant` field in `IPAddressSerializer` should be
shown like following as a request body:

```
tenant: integer ...
```

while it should be shown like following as a response body:

```
tenant: {
    id: integer ...,
    url: string ...,
    name: string ...,
    slug: string ...
}
```

But in both cases, it is shown as a response body type expression. This
causes an error at sending an API request with that type value.

It is only an API view issue, API can handle a request if a request
parameter is structured as an expected request body by ignoring the
wrong expression.

This fixes the issue by replacing an implicitly used default auto schema
generator class by its sub class and returning a pseudo serializer with
'Writable' prefix at generating a request body. The reason to introduce
a new generator class is that there is no other point which can
distinguish a request and a response. It is not enough to distinguish
POST, PUT, PATCH methods from GET because former cases may return a JSON
object as a response but it is also represented as same as a request
body, causes another mismatch.

This also fixes `SerializedPKRelatedField` type field representation. It
should be shown as an array of primary keys in a request body.

Fixed #2400
2018-11-27 16:14:45 -05:00
Jeremy Stretch
d2744700c6 Fixes #2615: Tweak live search widget to use brief format for API requests 2018-11-27 12:41:00 -05:00
Jeremy Stretch
5d07a5a670 Fixes #2613: Decrease live search minimum characters to three 2018-11-27 12:20:52 -05:00
Jeremy Stretch
4da755e75f Formatting cleanup 2018-11-27 11:57:29 -05:00
Jeremy Stretch
bd7aee7c1f Closes #2614: Simplify calls of super() for Python 3 2018-11-27 10:52:24 -05:00
Jeremy Stretch
f3aef37163 Add developer guidance for the introduction of new dependencies 2018-11-27 10:45:10 -05:00
Jeremy Stretch
7d262296e1 Added a description and repo URL for each dependency 2018-11-27 09:51:48 -05:00
Jeremy Stretch
3f1b42d466 Release v2.5-beta2 v2.5-beta2 2018-11-26 16:27:57 -05:00
Jeremy Stretch
90a4b62976 Changelog for #2606 2018-11-26 14:41:09 -05:00
Daniel Sheppard
7346083b26 Fixes #2606 - Added MultipleChoiceFilter for form_factor (#2610)
* Fixes #2606 - Added MultipleChoiceFilter for form_factor

* Fixes #2606 - Add MultipleChoiceField for form_factor
Fixes error with too many lines.
2018-11-26 14:19:05 -05:00
Tyler Bigler
f052bbc36e Refactor Extras Migration Version Check (#2604)
* Add constant for DB_MINIMUM_VERSION

* Refactor verify_postgresql_version to use Django connection pg_version method for comparing versions.

* Remove StrictVersion import

* Remove DB_MINIMUM_VERSION as not necessary in constants.

* Define DB_MINIMUM_VERSION locally to freeze to migration.

* Refactor database version verification to use django builtin methods.
2018-11-26 14:16:37 -05:00
Jeremy Stretch
7d8ae5e763 Fixes #2609: Fixed exception when ChoiceField integer value is passed as a string 2018-11-26 14:05:57 -05:00
Jeremy Stretch
2bae50f501 Enforce consistent ordering of value/label keys for ChoiceField 2018-11-26 14:02:38 -05:00
Jeremy Stretch
a46f68c6e4 Fixes #2608: Fixed null outer_unit error on rack import 2018-11-26 13:41:35 -05:00
Jeremy Stretch
d59be2912e Closes #2601: Added a description field to pass-through ports 2018-11-20 21:28:19 -05:00
Jeremy Stretch
240d22696f Strip annotations from queryset when retrieving object count for API pagination 2018-11-20 21:02:06 -05:00
Jeremy Stretch
2b1516ea79 Changelog for #2602 2018-11-20 13:21:38 -05:00
Jeremy Stretch
89622f1ddf Fixes #2602: Return HTTP 204 when no new IPs/prefixes are available for provisioning 2018-11-20 13:03:59 -05:00
Jeremy Stretch
874acab90f Merge v2.4.8 2018-11-20 12:28:24 -05:00
Jeremy Stretch
34bfb899d1 Post-release version bump 2018-11-20 11:58:19 -05:00
Jeremy Stretch
55c153c5a9 Release v2.4.8 2018-11-20 11:56:14 -05:00
Jeremy Stretch
c29ae9b785 Added missing import buttons to cables list 2018-11-20 09:41:38 -05:00
Jeremy Stretch
5ce955a719 Fixed toggling of connection status for cable path endpoints 2018-11-20 09:23:30 -05:00
Jeremy Stretch
8c3a294384 Standardized behavior and display of connection_status 2018-11-19 15:26:06 -05:00
Jeremy Stretch
55cc327e05 Updated migrations 2018-11-19 13:44:18 -05:00
Jeremy Stretch
a324638f1f Improved logic for recording cable path connection status 2018-11-19 12:37:53 -05:00
Jeremy Stretch
3366a6ae3d Closes #2557: Added object view for tags 2018-11-15 16:47:41 -05:00
Jeremy Stretch
7dde370ee1 Fixes #2593: Fix toggling of connected cable's status 2018-11-15 14:23:23 -05:00
John Anderson
dfe6ba5603 #2583 changelog 2018-11-15 00:55:47 -05:00
John Anderson
fd9b2f2fda cleanup component filters and UI filter forms for device and device type - #2583 2018-11-15 00:42:01 -05:00
John Anderson
3c0181ef35 added logic to append &type=physical to interface API query for cable creation - #2585 2018-11-14 23:35:15 -05:00
Jeremy Stretch
641254b23a Closes #2053: Introduced the LOGIN_TIMEOUT configuration setting 2018-11-14 14:18:32 -05:00
Jeremy Stretch
63bd48003e Clean up cable termination types 2018-11-14 12:17:18 -05:00
Jeremy Stretch
23cde65add Fixes #2589: Virtual machine API serializer should require cluster assignment 2018-11-14 10:38:53 -05:00
Jeremy Stretch
408f632636 Fixes #2588: Catch all exceptions from failed NAPALM API Calls 2018-11-14 10:12:35 -05:00
Jeremy Stretch
83be0b5db4 Closes #2490: Added bulk editing for config contexts 2018-11-13 15:08:55 -05:00
Jeremy Stretch
7bed48f5fe Expanded device interfaces display to include MTU, MAC address, and tags 2018-11-13 14:18:00 -05:00
Jeremy Stretch
2fce7ebd8f Fixes #2565: Improved rendering of Markdown tables 2018-11-13 11:02:48 -05:00
Jeremy Stretch
f8e6cfbeba Closes #2426: Introduced SESSION_FILE_PATH configuration setting for authentication without write access to database 2018-11-13 10:31:44 -05:00
John Anderson
fc41359df6 removed blank line 2018-11-12 23:34:14 -05:00
John Anderson
5649024d93 #2586 changelog 2018-11-12 23:27:14 -05:00
John Anderson
65bc8f0254 resolved #2586 - tests for the Cable model clean method 2018-11-12 23:26:08 -05:00
John Anderson
7887a70b70 #2585 changelog 2018-11-12 23:20:17 -05:00
John Anderson
8a6913fe19 fixed #2585 - connections with virtual interfaces 2018-11-12 23:18:23 -05:00
John Anderson
7cd0e0b244 #2584 changelog 2018-11-12 22:19:30 -05:00
John Anderson
9543b5e716 fixed #2584 - validation for connecting front port to corresponding rear port 2018-11-12 22:15:06 -05:00
Jeremy Stretch
bc8dbfde7c Merge branch 'develop' into develop-2.5 2018-11-12 16:03:52 -05:00
Jeremy Stretch
0c33af2140 Fixes #2558: Filter on all tags when multiple are passed 2018-11-12 15:48:58 -05:00
Jeremy Stretch
b6a256dc5d Expanded the development style guide 2018-11-12 14:36:09 -05:00