MCPcopy
hub / github.com/django/django / response_add

Method response_add

django/contrib/auth/admin.py:237–251  ·  view source on GitHub ↗

Determine the HttpResponse for the add_view stage. It mostly defers to its superclass implementation but is customized because the User model has a slightly different workflow.

(self, request, obj, post_url_continue=None)

Source from the content-addressed store, hash-verified

235 )
236
237 def response_add(self, request, obj, post_url_continue=None):
238 """
239 Determine the HttpResponse for the add_view stage. It mostly defers to
240 its superclass implementation but is customized because the User model
241 has a slightly different workflow.
242 """
243 # We should allow further modification of the user just added i.e. the
244 # 'Save' button should behave like the 'Save and continue editing'
245 # button except in two scenarios:
246 # * The user has pressed the 'Save and add another' button
247 # * We are adding a user in a popup
248 if "_addanother" not in request.POST and IS_POPUP_VAR not in request.POST:
249 request.POST = request.POST.copy()
250 request.POST["_continue"] = 1
251 return super().response_add(request, obj, post_url_continue)

Callers

nothing calls this directly

Calls 1

copyMethod · 0.45

Tested by

no test coverage detected