mirror of
https://github.com/django/django.git
synced 2025-08-01 09:32:50 +00:00
Fixed #18697 -- Made values accepted for two customizable admin templates consistent.
Thanks and at cloverfastfood dot com for the report.
This commit is contained in:
parent
88e1715639
commit
b64d30405a
5 changed files with 28 additions and 8 deletions
|
@ -16,7 +16,7 @@ class Admin2(admin.AdminSite):
|
|||
login_form = forms.CustomAdminAuthenticationForm
|
||||
login_template = 'custom_admin/login.html'
|
||||
logout_template = 'custom_admin/logout.html'
|
||||
index_template = 'custom_admin/index.html'
|
||||
index_template = ['custom_admin/index.html'] # a list, to test fix for #18697
|
||||
password_change_template = 'custom_admin/password_change_form.html'
|
||||
password_change_done_template = 'custom_admin/password_change_done.html'
|
||||
|
||||
|
@ -40,6 +40,10 @@ class UserLimitedAdmin(UserAdmin):
|
|||
return qs.filter(is_superuser=False)
|
||||
|
||||
|
||||
class CustomPwdTemplateUserAdmin(UserAdmin):
|
||||
change_user_password_template = ['admin/auth/user/change_password.html'] # a list, to test fix for #18697
|
||||
|
||||
|
||||
site = Admin2(name="admin2")
|
||||
|
||||
site.register(models.Article, base_admin.ArticleAdmin)
|
||||
|
@ -50,3 +54,6 @@ site.register(models.ChapterXtra1, base_admin.ChapterXtra1Admin)
|
|||
site.register(User, UserLimitedAdmin)
|
||||
site.register(models.UndeletableObject, base_admin.UndeletableObjectAdmin)
|
||||
site.register(models.Simple, base_admin.AttributeErrorRaisingAdmin)
|
||||
|
||||
simple_site = Admin2(name='admin4')
|
||||
simple_site.register(User, CustomPwdTemplateUserAdmin)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue