mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-22 20:12:00 -06:00
#10094 changes from code review
This commit is contained in:
parent
f48aaf1c46
commit
8b1a462a60
@ -329,9 +329,9 @@ class ObjectEditView(GetReturnURLMixin, BaseObjectView):
|
||||
|
||||
def get_extra_addanother_params(self, request, params):
|
||||
"""
|
||||
Return a QueryDict of extra params to use on the Add Another button.
|
||||
Return a dictionary of extra parameters to use on the Add Another button.
|
||||
"""
|
||||
return params
|
||||
return {}
|
||||
|
||||
#
|
||||
# Request handlers
|
||||
@ -405,7 +405,7 @@ class ObjectEditView(GetReturnURLMixin, BaseObjectView):
|
||||
|
||||
# If cloning is supported, pre-populate a new instance of the form
|
||||
params = prepare_cloned_fields(obj)
|
||||
params = self.get_extra_addanother_params(request, params)
|
||||
params.update(self.get_extra_addanother_params(request))
|
||||
if params:
|
||||
if 'return_url' in request.GET:
|
||||
params['return_url'] = request.GET.get('return_url')
|
||||
|
@ -366,14 +366,11 @@ class ContactAssignmentEditView(generic.ObjectEditView):
|
||||
instance.object = get_object_or_404(content_type.model_class(), pk=request.GET.get('object_id'))
|
||||
return instance
|
||||
|
||||
def get_extra_addanother_params(self, request, params: dict):
|
||||
if not params:
|
||||
params = QueryDict(mutable=True)
|
||||
|
||||
params['content_type'] = request.GET.get('content_type')
|
||||
params['object_id'] = request.GET.get('object_id')
|
||||
|
||||
return params
|
||||
def get_extra_addanother_params(self, request):
|
||||
return {
|
||||
'content_type': request.GET.get('content_type'),
|
||||
'object_id': request.GET.get('object_id'),
|
||||
}
|
||||
|
||||
|
||||
class ContactAssignmentDeleteView(generic.ObjectDeleteView):
|
||||
|
Loading…
Reference in New Issue
Block a user