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

2147 Commits

Author SHA1 Message Date
John Anderson
0dcab07519 fixes #2623 - model class being passed to rqworker 2018-12-04 00:40:54 -05:00
Jeremy Stretch
ca0248c3a2 Closes #2089: Add SONET interface form factors 2018-11-30 09:28:56 -05:00
Jeremy Stretch
a43fc0d3d3 Closes #2560: Add slug to DeviceType UI view 2018-11-28 16:19:05 -05:00
Jeremy Stretch
6c2a9107dd Closes #2597: Add FibreChannel SFP28 (32GFC) interface form factor 2018-11-28 09:56:48 -05:00
Jeremy Stretch
c6d048ca51 Fixes #2576: Correct type for count_* fields in site API representation 2018-11-27 16:27:47 -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
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
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
3366a6ae3d Closes #2557: Added object view for tags 2018-11-15 16:47:41 -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
0c33af2140 Fixes #2558: Filter on all tags when multiple are passed 2018-11-12 15:48:58 -05:00
Jeremy Stretch
845d467fd9 Fixes #2575: Correct model specified for rack roles table 2018-11-09 09:46:30 -05:00
Jeremy Stretch
69d829ce8d Fixes #2473: Fix encoding of long (>127 character) secrets 2018-11-07 13:44:16 -05:00
Jeremy Stretch
c1838104ae Add lag description to lag column 2018-11-07 12:20:14 -05:00
Jeremy Stretch
c716ca1e87 Changelog query optimization 2018-11-07 10:42:04 -05:00
Jeremy Stretch
8bad25b860 Post-release version bump 2018-11-06 10:57:38 -05:00
Jeremy Stretch
99edb8b8d5 Release v2.4.7 2018-11-06 10:49:44 -05:00
Jeremy Stretch
b4998f4b01 Closes #2388: Enable filtering of devices/VMs by region 2018-11-06 10:31:56 -05:00
John Anderson
51295389c6 add temporary support for hyphenated query params for #2549 2018-11-06 10:08:00 -05:00
Jeremy Stretch
fd4a9db13e Closes #2512: Add device field to inventory item filter form 2018-11-06 09:24:05 -05:00
John Anderson
817dc89279 fixed test for #2549 2018-11-06 00:54:57 -05:00
John Anderson
798a87b31e fixed #2549 - incorrect naming of peer-device and peer-interface 2018-11-06 00:51:55 -05:00
Jeremy Stretch
bd3ccfe020 Fixes #2528: Enable creating circuit terminations with interface assignment via API 2018-11-05 16:10:01 -05:00
Jeremy Stretch
ded90df01b Filter cleanup 2018-11-05 15:45:21 -05:00
Daniel Sheppard
82b4aad585 Fixes 2427: Added filtering interfaces by vlan id(vlan=#) and vlan pk(vlan_id=#) (#2521) 2018-11-05 15:37:52 -05:00
knobix
0c86fd89ca Update models.py (#2502)
Fix the handling of shared IPs (VIP, VRRF, etc.) when unique IP space enforcement is set.

Add parentheses for the logical OR-statement to make the evaluation valid.

Fixes: #2501
2018-11-05 15:33:10 -05:00
Jeremy Stretch
0bb5d229e8 Fixes #2514: Prevent new connections to already connected interfaces 2018-10-16 16:42:23 -04:00
Tobias Genannt
c31c7b50b7 Fix #2395: Modify only when webhooks are enabled
This only adds the RQ link when the webhooks setting is enabled.
2018-10-08 07:34:56 +02:00
Jeremy Stretch
7d1f6b7049 Post-release version bump 2018-10-05 15:49:51 -04:00
Jeremy Stretch
c2f4cf3407 Release v2.4.6 2018-10-05 15:43:43 -04:00
Jeremy Stretch
44d3606ce1 Fixes #2492: Sanitize hostname and port values returned through LLDP 2018-10-05 15:38:32 -04:00
Jeremy Stretch
470d22c835 PEP8 fix 2018-10-05 15:36:48 -04:00
Jeremy Stretch
4c37628784 Fixes #2393: Fix Unicode support for CSV import under Python 2 2018-10-05 15:33:29 -04:00
Marc Heckmann
1daf7f8e2b Sanitize hostname and port values returned through LLDP
If hostname or port are null set to empty string ("").

This avoids breaking the LLDP neighbors (NAPALM) view
2018-10-05 14:30:54 -04:00
Jeremy Stretch
841db3b0c2 Fixes #2491: Fix exception when importing devices with invalid device type 2018-10-05 12:22:46 -04:00
Jeremy Stretch
5d10d8418e Closes #2479: Add user permissions for creating/modifying API tokens 2018-10-05 11:06:59 -04:00
Jeremy Stretch
2fee977b4c Fixes #2485: Fix cancel button when assigning a service to a device/VM 2018-10-05 10:30:13 -04:00
Jeremy Stretch
259da2d18a #2487: Added API tests 2018-10-04 16:20:01 -04:00
Jeremy Stretch
bf47e7cae3 #2487: Require the 'brief' parameter to evaluate True 2018-10-04 14:50:57 -04:00
Jeremy Stretch
db2721c581 Enable brief API output utilizing nested serializers 2018-10-04 13:43:50 -04:00
John Anderson
1b2e9a6d06 fixes #2484 - Local config context not available on the Virtual Machine Edit Form 2018-10-03 17:16:01 -04:00
Jeremy Stretch
99848aab6a Fixes #2483: Set max item count of API-populated form fields to MAX_PAGE_SIZE 2018-10-03 16:17:17 -04:00