Code

Ticket #6470: nfa-options.diff

File nfa-options.diff, 849 bytes (added by tlpinney, 6 years ago)
Line 
1diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py
2index ec32c89..0989600 100644
3--- a/django/contrib/admin/options.py
4+++ b/django/contrib/admin/options.py
5@@ -246,11 +246,11 @@ class ModelAdmin(BaseModelAdmin):
6         # Delegate to the appropriate method, based on the URL.
7         if url is None:
8             return self.changelist_view(request)
9-        elif url.endswith('add'):
10+        elif url == 'add':
11             return self.add_view(request)
12-        elif url.endswith('history'):
13+        elif url.endswith('/history'):
14             return self.history_view(request, unquote(url[:-8]))
15-        elif url.endswith('delete'):
16+        elif url.endswith('/delete'):
17             return self.delete_view(request, unquote(url[:-7]))
18         else:
19             return self.change_view(request, unquote(url))