diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 9af9647f0..6ee058e89 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -17,7 +17,7 @@ body: What version of NetBox are you currently running? (If you don't have access to the most recent NetBox release, consider testing on our [demo instance](https://demo.netbox.dev/) before opening a bug report to see if your issue has already been addressed.) - placeholder: v2.11.4 + placeholder: v2.11.5 validations: required: true - type: dropdown diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 3e1d0167d..1f8fdebd4 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -3,7 +3,10 @@ blank_issues_enabled: false contact_links: - name: 📖 Contributing Policy url: https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md - about: Please read through our contributing policy before opening an issue or pull request - - name: 💬 Discussion Group - url: https://groups.google.com/g/netbox-discuss - about: Join our discussion group for assistance with installation issues and other problems + about: "Please read through our contributing policy before opening an issue or pull request" + - name: ❓ Discussion + url: https://github.com/netbox-community/netbox/discussions + about: "If you're just looking for help, try starting a discussion instead" + - name: 💬 Community Slack + url: https://netdev.chat/ + about: "Join #netbox on the NetDev Community Slack for assistance with installation issues and other problems" diff --git a/.github/ISSUE_TEMPLATE/feature_request.yaml b/.github/ISSUE_TEMPLATE/feature_request.yaml index b6e53491e..c18fc3a1a 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yaml +++ b/.github/ISSUE_TEMPLATE/feature_request.yaml @@ -14,7 +14,7 @@ body: attributes: label: NetBox version description: What version of NetBox are you currently running? - placeholder: v2.11.4 + placeholder: v2.11.5 validations: required: true - type: dropdown diff --git a/docs/additional-features/custom-scripts.md b/docs/additional-features/custom-scripts.md index 3ed910791..8fe3661ed 100644 --- a/docs/additional-features/custom-scripts.md +++ b/docs/additional-features/custom-scripts.md @@ -175,7 +175,7 @@ A particular object within NetBox. Each ObjectVar must specify a particular mode * `null_option` - A label representing a "null" or empty choice (optional) !!! warning - The `display_field` parameter is now deprecated, and will be removed in NetBox v2.12. All ObjectVar instances will + The `display_field` parameter is now deprecated, and will be removed in NetBox v3.0. All ObjectVar instances will instead use the new standard `display` field for all serializers (introduced in NetBox v2.11). To limit the selections available within the list, additional query parameters can be passed as the `query_params` dictionary. For example, to show only devices with an "active" status: diff --git a/docs/additional-features/reports.md b/docs/additional-features/reports.md index bac1003fd..0d75abd21 100644 --- a/docs/additional-features/reports.md +++ b/docs/additional-features/reports.md @@ -80,7 +80,7 @@ class DeviceConnectionsReport(Report): self.log_success(device) ``` -As you can see, reports are completely customizable. Validation logic can be as simple or as complex as needed. +As you can see, reports are completely customizable. Validation logic can be as simple or as complex as needed. Also note that the `description` attribute support markdown syntax. It will be rendered in the report list page. !!! warning Reports should never alter data: If you find yourself using the `create()`, `save()`, `update()`, or `delete()` methods on objects within reports, stop and re-evaluate what you're trying to accomplish. Note that there are no safeguards against the accidental alteration or destruction of data. @@ -93,7 +93,7 @@ The following methods are available to log results within a report: * log_warning(object, message) * log_failure(object, message) -The recording of one or more failure messages will automatically flag a report as failed. It is advised to log a success for each object that is evaluated so that the results will reflect how many objects are being reported on. (The inclusion of a log message is optional for successes.) Messages recorded with `log()` will appear in a report's results but are not associated with a particular object or status. +The recording of one or more failure messages will automatically flag a report as failed. It is advised to log a success for each object that is evaluated so that the results will reflect how many objects are being reported on. (The inclusion of a log message is optional for successes.) Messages recorded with `log()` will appear in a report's results but are not associated with a particular object or status. Log messages also support using markdown syntax and will be rendered on the report result page. To perform additional tasks, such as sending an email or calling a webhook, after a report has been run, extend the `post_run()` method. The status of the report is available as `self.failed` and the results object is `self.result`. diff --git a/docs/installation/index.md b/docs/installation/index.md index 2ae5e5299..1c2fcf567 100644 --- a/docs/installation/index.md +++ b/docs/installation/index.md @@ -24,7 +24,7 @@ The video below demonstrates the installation of NetBox v2.10.3 on Ubuntu 20.04 | Redis | 4.0 | !!! note - Python 3.7 or later will be required in NetBox v2.12. Users are strongly encouraged to install NetBox using Python 3.7 or later for new deployments. + Python 3.7 or later will be required in NetBox v3.0. Users are strongly encouraged to install NetBox using Python 3.7 or later for new deployments. Below is a simplified overview of the NetBox application stack for reference: diff --git a/docs/release-notes/version-2.11.md b/docs/release-notes/version-2.11.md index 4a0fcef8f..db773e2bd 100644 --- a/docs/release-notes/version-2.11.md +++ b/docs/release-notes/version-2.11.md @@ -1,5 +1,30 @@ # NetBox v2.11 +## v2.11.5 (2021-06-04) + +**NOTE:** This release includes a database migration that calculates and annotates prefix depth. It may impose a noticeable delay on the upgrade process: Users should anticipate roughly one minute of delay per 100 thousand prefixes being updated. + +### Enhancements + +* [#6087](https://github.com/netbox-community/netbox/issues/6087) - Improved prefix hierarchy rendering +* [#6487](https://github.com/netbox-community/netbox/issues/6487) - Add location filter to cable connection form +* [#6501](https://github.com/netbox-community/netbox/issues/6501) - Expose prefix depth and children on REST API serializer +* [#6527](https://github.com/netbox-community/netbox/issues/6527) - Support Markdown for report descriptions +* [#6540](https://github.com/netbox-community/netbox/issues/6540) - Add a "flat" column to the prefix table + +### Bug Fixes + +* [#6064](https://github.com/netbox-community/netbox/issues/6064) - Fix object permission assignments for user and group models +* [#6217](https://github.com/netbox-community/netbox/issues/6217) - Disallow passing of string values for integer custom fields +* [#6284](https://github.com/netbox-community/netbox/issues/6284) - Avoid sending redundant webhooks when adding/removing tags +* [#6492](https://github.com/netbox-community/netbox/issues/6492) - Correct tag population in post-change data resulting from REST API changes +* [#6496](https://github.com/netbox-community/netbox/issues/6496) - Fix upgrade script when Python installed in nonstandard path +* [#6502](https://github.com/netbox-community/netbox/issues/6502) - Correct permissions evaluation for running a report via the REST API +* [#6517](https://github.com/netbox-community/netbox/issues/6517) - Fix assignment of user when creating rack reservations via REST API +* [#6525](https://github.com/netbox-community/netbox/issues/6525) - Paginate related IPs table under IP address view + +--- + ## v2.11.4 (2021-05-25) ### Enhancements @@ -93,7 +118,7 @@ ## v2.11.0 (2021-04-16) -**Note:** NetBox v2.11 is the last major release that will support Python 3.6. Beginning with NetBox v2.12, Python 3.7 or later will be required. +**Note:** NetBox v2.11 is the last major release that will support Python 3.6. Beginning with NetBox v3.0, Python 3.7 or later will be required. ### Breaking Changes @@ -151,7 +176,7 @@ Devices can now be assigned to locations (formerly known as rack groups) within When exporting a list of objects in NetBox, users now have the option of selecting the "current view". This will render CSV output matching the current configuration of the table being viewed. For example, if you modify the sites list to display only the site name, tenant, and status, the rendered CSV will include only these columns, and they will appear in the order chosen. -The legacy static export behavior has been retained to ensure backward compatibility for dependent integrations. However, users are strongly encouraged to adapt custom export templates where needed as this functionality will be removed in v2.12. +The legacy static export behavior has been retained to ensure backward compatibility for dependent integrations. However, users are strongly encouraged to adapt custom export templates where needed as this functionality will be removed in v3.0. #### Variable Scope Support for VLAN Groups ([#5284](https://github.com/netbox-community/netbox/issues/5284)) diff --git a/netbox/dcim/api/views.py b/netbox/dcim/api/views.py index 9d402227f..47ab26828 100644 --- a/netbox/dcim/api/views.py +++ b/netbox/dcim/api/views.py @@ -246,10 +246,6 @@ class RackReservationViewSet(ModelViewSet): serializer_class = serializers.RackReservationSerializer filterset_class = filtersets.RackReservationFilterSet - # Assign user from request - def perform_create(self, serializer): - serializer.save(user=self.request.user) - # # Manufacturers diff --git a/netbox/dcim/forms.py b/netbox/dcim/forms.py index efb712963..c9c7c86a6 100644 --- a/netbox/dcim/forms.py +++ b/netbox/dcim/forms.py @@ -3923,13 +3923,23 @@ class ConnectCableToDeviceForm(BootstrapMixin, CustomFieldModelForm): 'group_id': '$termination_b_site_group', } ) + termination_b_location = DynamicModelChoiceField( + queryset=Location.objects.all(), + label='Location', + required=False, + null_option='None', + query_params={ + 'site_id': '$termination_b_site' + } + ) termination_b_rack = DynamicModelChoiceField( queryset=Rack.objects.all(), label='Rack', required=False, null_option='None', query_params={ - 'site_id': '$termination_b_site' + 'site_id': '$termination_b_site', + 'location_id': '$termination_b_location', } ) termination_b_device = DynamicModelChoiceField( diff --git a/netbox/dcim/tests/test_api.py b/netbox/dcim/tests/test_api.py index 24130c649..5e7f44203 100644 --- a/netbox/dcim/tests/test_api.py +++ b/netbox/dcim/tests/test_api.py @@ -349,40 +349,36 @@ class RackReservationTest(APIViewTestCases.APIViewTestCase): user = User.objects.create(username='user1', is_active=True) site = Site.objects.create(name='Test Site 1', slug='test-site-1') - cls.racks = ( + racks = ( Rack(site=site, name='Rack 1'), Rack(site=site, name='Rack 2'), ) - Rack.objects.bulk_create(cls.racks) + Rack.objects.bulk_create(racks) rack_reservations = ( - RackReservation(rack=cls.racks[0], units=[1, 2, 3], user=user, description='Reservation #1'), - RackReservation(rack=cls.racks[0], units=[4, 5, 6], user=user, description='Reservation #2'), - RackReservation(rack=cls.racks[0], units=[7, 8, 9], user=user, description='Reservation #3'), + RackReservation(rack=racks[0], units=[1, 2, 3], user=user, description='Reservation #1'), + RackReservation(rack=racks[0], units=[4, 5, 6], user=user, description='Reservation #2'), + RackReservation(rack=racks[0], units=[7, 8, 9], user=user, description='Reservation #3'), ) RackReservation.objects.bulk_create(rack_reservations) - def setUp(self): - super().setUp() - - # We have to set creation data under setUp() because we need access to the test user. - self.create_data = [ + cls.create_data = [ { - 'rack': self.racks[1].pk, + 'rack': racks[1].pk, 'units': [10, 11, 12], - 'user': self.user.pk, + 'user': user.pk, 'description': 'Reservation #4', }, { - 'rack': self.racks[1].pk, + 'rack': racks[1].pk, 'units': [13, 14, 15], - 'user': self.user.pk, + 'user': user.pk, 'description': 'Reservation #5', }, { - 'rack': self.racks[1].pk, + 'rack': racks[1].pk, 'units': [16, 17, 18], - 'user': self.user.pk, + 'user': user.pk, 'description': 'Reservation #6', }, ] diff --git a/netbox/extras/api/views.py b/netbox/extras/api/views.py index 7e6c97782..fbeba8328 100644 --- a/netbox/extras/api/views.py +++ b/netbox/extras/api/views.py @@ -239,7 +239,7 @@ class ReportViewSet(ViewSet): Run a Report identified as ".