Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix OrderedDefaultRouter APIRootView warning #164

Merged
merged 11 commits into from
May 23, 2024
1 change: 1 addition & 0 deletions changes/162.added
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added view name to `OrderedDefaultRouter`.
1 change: 1 addition & 0 deletions changes/162.removed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Removed `DataValidationEngineRootView` class and `APIRootView` override.
3 changes: 1 addition & 2 deletions nautobot_data_validation_engine/api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
from nautobot_data_validation_engine.api import views


router = OrderedDefaultRouter()
router.APIRootView = views.DataValidationEngineRootView
router = OrderedDefaultRouter(view_name="Data Validation Engine")
DistantVoyager marked this conversation as resolved.
Show resolved Hide resolved

# Regular expression rules
router.register("regex-rules", views.RegularExpressionValidationRuleViewSet)
Expand Down
10 changes: 0 additions & 10 deletions nautobot_data_validation_engine/api/views.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
"""API views."""

from rest_framework.routers import APIRootView

from nautobot.extras.api.views import NautobotModelViewSet

from nautobot_data_validation_engine.api import serializers
from nautobot_data_validation_engine import models, filters


class DataValidationEngineRootView(APIRootView):
"""Data Validation Engine API root view."""

def get_view_name(self):
"""Get the name of the view."""
return "Data Validation Engine"


class RegularExpressionValidationRuleViewSet(NautobotModelViewSet):
"""View to manage regular expression validation rules."""

Expand Down
Loading