1
0
mirror of https://github.com/django/django.git synced 2025-10-24 22:26:08 +00:00

Fixed #15779 -- Allowed 'add' primary key in admin edition

Thanks Marwan Alsabbagh for the report, and Simon Charette and
Tim Graham for the reviews.
This commit is contained in:
Claude Paroz
2015-02-07 17:55:47 +01:00
parent 47ee7b48ad
commit 1791a7e75a
5 changed files with 31 additions and 9 deletions

View File

@@ -693,7 +693,7 @@ class UnchangeableObjectAdmin(admin.ModelAdmin):
def get_urls(self):
# Disable change_view, but leave other urls untouched
urlpatterns = super(UnchangeableObjectAdmin, self).get_urls()
return [p for p in urlpatterns if not p.name.endswith("_change")]
return [p for p in urlpatterns if p.name and not p.name.endswith("_change")]
def callable_on_unknown(obj):