Skip to content

Commit

Permalink
Merge pull request #200 from nautobot/u/whitej6-issue-199
Browse files Browse the repository at this point in the history
Closes: #199 - incorrect reverse in template
  • Loading branch information
whitej6 authored Jan 4, 2024
2 parents 115d456 + 7787535 commit d6b1356
Show file tree
Hide file tree
Showing 8 changed files with 1,026 additions and 795 deletions.
1 change: 1 addition & 0 deletions changes/199.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Resolve incorrect reverse for custom viewset
26 changes: 20 additions & 6 deletions docs/admin/release_notes/version_2.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,38 @@

This document describes all new features and changes in the release `2.0`. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## v2.0.2 - 2024-01-04

### Fixed

- [#199](https://github.com/nautobot/nautobot-app-firewall-models/issues/199) Resolve incorrect reverse for custom viewset

### Added

- [#199](https://github.com/nautobot/nautobot-app-firewall-models/issues/199) Added towncrier changelogs

### Changed

- [#195](https://github.com/nautobot/nautobot-app-firewall-models/pull/195) Replace references to `plugin` with `app`

## v2.0.1 - 2023-10-04

### Fixed

- [#173](https://github.com/nautobot/nautobot-plugin-firewall-models/issues/173) Resolve issues with v2 migrations
- [#173](https://github.com/nautobot/nautobot-app-firewall-models/issues/173) Resolve issues with v2 migrations

## v2.0.0 - 2023-09-29

### Changed

- [#167](https://github.com/nautobot/nautobot-plugin-firewall-models/pull/167) Nautobot 2.0.0 as minimum dependency
- [#167](https://github.com/nautobot/nautobot-plugin-firewall-models/pull/167) Substantial updates to API
- [#167](https://github.com/nautobot/nautobot-plugin-firewall-models/pull/167) on_delete=PROTECT was moved from the model custom through field to a DB signal
- [#167](https://github.com/nautobot/nautobot-app-firewall-models/pull/167) Nautobot 2.0.0 as minimum dependency
- [#167](https://github.com/nautobot/nautobot-app-firewall-models/pull/167) Substantial updates to API
- [#167](https://github.com/nautobot/nautobot-app-firewall-models/pull/167) on_delete=PROTECT was moved from the model custom through field to a DB signal

### Added

- [#167](https://github.com/nautobot/nautobot-plugin-firewall-models/pull/167) Added support for Python 3.11
- [#167](https://github.com/nautobot/nautobot-app-firewall-models/pull/167) Added support for Python 3.11

### Removed

- [#167](https://github.com/nautobot/nautobot-plugin-firewall-models/pull/167) Dropped support for Python 3.7
- [#167](https://github.com/nautobot/nautobot-app-firewall-models/pull/167) Dropped support for Python 3.7
8 changes: 8 additions & 0 deletions nautobot_firewall_models/tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,14 @@ def assign_policies(): # pylint: disable=too-many-locals
status=status,
platform=jun_platform,
)
Device.objects.get_or_create(
name="DFW02-WAN01",
role=dev_role,
device_type=jun_dev_type,
location=site1,
status=status,
platform=jun_platform,
)
dev2, _ = Device.objects.get_or_create(
name="HOU02-WAN00",
role=dev_role,
Expand Down
14 changes: 14 additions & 0 deletions nautobot_firewall_models/tests/test_ui_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# flake8: noqa: F403,405
# pylint: disable=invalid-name
# pylint: disable=duplicate-code
from nautobot.dcim.models import Device
from nautobot.extras.models.statuses import Status
from nautobot.apps.testing import ViewTestCases

Expand Down Expand Up @@ -384,3 +385,16 @@ def setUpTestData(cls):
f'csvrule2,"{nat_pol_rule.id}",Active',
f'csvrule3,"{nat_pol_rule.id}",Active',
)


class CapircaPolicyUIViewTest(ViewTestCases.GetObjectViewTestCase, ViewTestCases.ListObjectsViewTestCase):
"""Test the Policy viewsets."""

model = CapircaPolicy

@classmethod
def setUpTestData(cls):
"""Create test data."""
fixtures.create_capirca_env()
for device in Device.objects.all():
CapircaPolicy.objects.create(device=device)
2 changes: 1 addition & 1 deletion nautobot_firewall_models/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
router.register("application-object", viewsets.ApplicationObjectUIViewSet)
router.register("application-object-group", viewsets.ApplicationObjectGroupUIViewSet)
router.register("capirca-policy", viewsets.CapircaPolicyUIViewSet)
router.register("capirca-policy-device", viewsets.CapircaPolicyDeviceUIViewSet)
router.register("capirca-policy-device", viewsets.CapircaPolicyDeviceUIViewSet, basename="capircapolicy_devicedetail")
router.register("fqdn", viewsets.FQDNUIViewSet)
router.register("ip-range", viewsets.IPRangeUIViewSet)
router.register("nat-policy", viewsets.NATPolicyUIViewSet)
Expand Down
2 changes: 1 addition & 1 deletion nautobot_firewall_models/viewsets/capirca_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class CapircaPolicyUIViewSet(
queryset = models.CapircaPolicy.objects.all()
serializer_class = serializers.CapircaPolicySerializer
table_class = tables.CapircaPolicyTable
action_buttons = ("add",)
action_buttons = None

lookup_field = "pk"

Expand Down
Loading

0 comments on commit d6b1356

Please sign in to comment.