diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py
index 787f856..b6258f3 100644
a
|
b
|
from django.contrib import messages
|
10 | 10 | from django.views.decorators.csrf import csrf_protect |
11 | 11 | from django.core.exceptions import PermissionDenied, ValidationError |
12 | 12 | from django.core.paginator import Paginator |
| 13 | from django.core.urlresolvers import reverse |
13 | 14 | from django.db import models, transaction, router |
14 | 15 | from django.db.models.related import RelatedObject |
15 | 16 | from django.db.models.fields import BLANK_CHOICE_DASH, FieldDoesNotExist |
… |
… |
class ModelAdmin(BaseModelAdmin):
|
716 | 717 | "admin/change_form.html" |
717 | 718 | ], context, current_app=self.admin_site.name) |
718 | 719 | |
719 | | def response_add(self, request, obj, post_url_continue='../%s/'): |
| 720 | def response_add(self, request, obj, post_url_continue=None): |
720 | 721 | """ |
721 | 722 | Determines the HttpResponse for the add_view stage. |
722 | 723 | """ |
… |
… |
class ModelAdmin(BaseModelAdmin):
|
728 | 729 | # the presence of keys in request.POST. |
729 | 730 | if "_continue" in request.POST: |
730 | 731 | self.message_user(request, msg + ' ' + _("You may edit it again below.")) |
| 732 | if post_url_continue is None: |
| 733 | post_url_continue = reverse("admin:%s_%s_change" % (opts.app_label, opts.module_name), args=(pk_value,), current_app=self.admin_site.name) |
| 734 | |
731 | 735 | if "_popup" in request.POST: |
732 | 736 | post_url_continue += "?_popup=1" |
733 | | return HttpResponseRedirect(post_url_continue % pk_value) |
| 737 | return HttpResponseRedirect(post_url_continue) |
734 | 738 | |
735 | 739 | if "_popup" in request.POST: |
736 | 740 | return HttpResponse('<script type="text/javascript">opener.dismissAddAnotherPopup(window, "%s", "%s");</script>' % \ |