mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-23 04:22:01 -06:00
Closes #6434: Add deprecation warning for stock secrets functionality
This commit is contained in:
parent
546bbe5418
commit
a39522a25e
@ -86,6 +86,18 @@ class SecretRoleBulkDeleteView(generic.BulkDeleteView):
|
|||||||
# Secrets
|
# Secrets
|
||||||
#
|
#
|
||||||
|
|
||||||
|
def inject_deprecation_warning(request):
|
||||||
|
"""
|
||||||
|
Inject a warning message notifying the user of the pending removal of secrets functionality.
|
||||||
|
"""
|
||||||
|
messages.warning(
|
||||||
|
request,
|
||||||
|
mark_safe('<i class="mdi mdi-alert"></i> The secrets functionality will be moved to a plugin in NetBox v2.12. '
|
||||||
|
'Please see <a href="https://github.com/netbox-community/netbox/issues/5278">issue #5278</a> for '
|
||||||
|
'more information.')
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class SecretListView(generic.ObjectListView):
|
class SecretListView(generic.ObjectListView):
|
||||||
queryset = Secret.objects.all()
|
queryset = Secret.objects.all()
|
||||||
filterset = filtersets.SecretFilterSet
|
filterset = filtersets.SecretFilterSet
|
||||||
@ -93,10 +105,18 @@ class SecretListView(generic.ObjectListView):
|
|||||||
table = tables.SecretTable
|
table = tables.SecretTable
|
||||||
action_buttons = ('import', 'export')
|
action_buttons = ('import', 'export')
|
||||||
|
|
||||||
|
def get(self, request):
|
||||||
|
inject_deprecation_warning(request)
|
||||||
|
return super().get(request)
|
||||||
|
|
||||||
|
|
||||||
class SecretView(generic.ObjectView):
|
class SecretView(generic.ObjectView):
|
||||||
queryset = Secret.objects.all()
|
queryset = Secret.objects.all()
|
||||||
|
|
||||||
|
def get(self, request, *args, **kwargs):
|
||||||
|
inject_deprecation_warning(request)
|
||||||
|
return super().get(request, *args, **kwargs)
|
||||||
|
|
||||||
|
|
||||||
class SecretEditView(generic.ObjectEditView):
|
class SecretEditView(generic.ObjectEditView):
|
||||||
queryset = Secret.objects.all()
|
queryset = Secret.objects.all()
|
||||||
|
Loading…
Reference in New Issue
Block a user