File tree 1 file changed +20
-0
lines changed
1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -86,17 +86,37 @@ class SecretRoleBulkDeleteView(generic.BulkDeleteView):
86
86
# Secrets
87
87
#
88
88
89
+ def inject_deprecation_warning (request ):
90
+ """
91
+ Inject a warning message notifying the user of the pending removal of secrets functionality.
92
+ """
93
+ messages .warning (
94
+ request ,
95
+ mark_safe ('<i class="mdi mdi-alert"></i> The secrets functionality will be moved to a plugin in NetBox v2.12. '
96
+ 'Please see <a href="https://github.com/netbox-community/netbox/issues/5278">issue #5278</a> for '
97
+ 'more information.' )
98
+ )
99
+
100
+
89
101
class SecretListView (generic .ObjectListView ):
90
102
queryset = Secret .objects .all ()
91
103
filterset = filtersets .SecretFilterSet
92
104
filterset_form = forms .SecretFilterForm
93
105
table = tables .SecretTable
94
106
action_buttons = ('import' , 'export' )
95
107
108
+ def get (self , request ):
109
+ inject_deprecation_warning (request )
110
+ return super ().get (request )
111
+
96
112
97
113
class SecretView (generic .ObjectView ):
98
114
queryset = Secret .objects .all ()
99
115
116
+ def get (self , request , * args , ** kwargs ):
117
+ inject_deprecation_warning (request )
118
+ return super ().get (request , * args , ** kwargs )
119
+
100
120
101
121
class SecretEditView (generic .ObjectEditView ):
102
122
queryset = Secret .objects .all ()
You can’t perform that action at this time.
0 commit comments