mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user