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)
| 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) |