mirror of
https://github.com/django/django.git
synced 2025-07-04 17:59:13 +00:00
newforms-admin: Removed post_url option from add_view -- it was undocumented and hasn't been used since before Django was open-sourced
git-svn-id: http://code.djangoproject.com/svn/django/branches/newforms-admin@4345 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
2957fedd40
commit
84c5094769
@ -151,7 +151,7 @@ class ModelAdmin(object):
|
||||
def change_list_queryset(self, request):
|
||||
return self.model._default_manager.get_query_set()
|
||||
|
||||
def add_view(self, request, form_url='', post_url=None, post_url_continue='../%s/'):
|
||||
def add_view(self, request, form_url='', post_url_continue='../%s/'):
|
||||
"The 'add' admin view for this model."
|
||||
from django.contrib.admin.views.main import render_change_form
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
@ -163,13 +163,12 @@ class ModelAdmin(object):
|
||||
if not self.has_add_permission(request):
|
||||
raise PermissionDenied
|
||||
|
||||
if post_url is None:
|
||||
if self.has_change_permission(request, None):
|
||||
# redirect to list view
|
||||
post_url = '../'
|
||||
else:
|
||||
# Object list will give 'Permission Denied', so go back to admin home
|
||||
post_url = '../../../'
|
||||
if self.has_change_permission(request, None):
|
||||
# redirect to list view
|
||||
post_url = '../'
|
||||
else:
|
||||
# Object list will give 'Permission Denied', so go back to admin home
|
||||
post_url = '../../../'
|
||||
|
||||
manipulator = model.AddManipulator()
|
||||
if request.POST:
|
||||
|
Loading…
x
Reference in New Issue
Block a user