Skip to content

Commit adc0065

Browse files
committed
added extra add another param
1 parent c462bf0 commit adc0065

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

netbox_acls/views.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,16 @@ class ACLInterfaceAssignmentEditView(generic.ObjectEditView):
136136
form = forms.ACLInterfaceAssignmentForm
137137
template_name = "netbox_acls/aclinterfaceassignment_edit.html"
138138

139+
def get_extra_addanother_params(self, request):
140+
"""
141+
Returns a dictionary of additional parameters to be passed to the "Add Another" button.
142+
"""
143+
144+
return {
145+
"access_list": request.GET.get("access_list") or request.POST.get("access_list"),
146+
"direction": request.GET.get("direction") or request.POST.get("direction"),
147+
}
148+
139149

140150
class ACLInterfaceAssignmentDeleteView(generic.ObjectDeleteView):
141151
"""
@@ -183,6 +193,15 @@ class ACLStandardRuleEditView(generic.ObjectEditView):
183193
queryset = models.ACLStandardRule.objects.all()
184194
form = forms.ACLStandardRuleForm
185195

196+
def get_extra_addanother_params(self, request):
197+
"""
198+
Returns a dictionary of additional parameters to be passed to the "Add Another" button.
199+
"""
200+
201+
return {
202+
"access_list": request.GET.get("access_list") or request.POST.get("access_list"),
203+
}
204+
186205

187206
class ACLStandardRuleDeleteView(generic.ObjectDeleteView):
188207
"""
@@ -230,6 +249,15 @@ class ACLExtendedRuleEditView(generic.ObjectEditView):
230249
queryset = models.ACLExtendedRule.objects.all()
231250
form = forms.ACLExtendedRuleForm
232251

252+
def get_extra_addanother_params(self, request):
253+
"""
254+
Returns a dictionary of additional parameters to be passed to the "Add Another" button.
255+
"""
256+
257+
return {
258+
"access_list": request.GET.get("access_list") or request.POST.get("access_list"),
259+
}
260+
233261

234262
class ACLExtendedRuleDeleteView(generic.ObjectDeleteView):
235263
"""

0 commit comments

Comments
 (0)