mirror of
https://github.com/jazzband/django-constance.git
synced 2026-03-16 22:40:24 +00:00
Add each_context to context and use dict syntax (#176)
This commit is contained in:
parent
e634a624ec
commit
8da8b4278c
1 changed files with 10 additions and 9 deletions
|
|
@ -189,15 +189,16 @@ class ConstanceAdmin(admin.ModelAdmin):
|
|||
_('Live settings updated successfully.'),
|
||||
)
|
||||
return HttpResponseRedirect('.')
|
||||
context = {
|
||||
'config_values': [],
|
||||
'title': self.model._meta.app_config.verbose_name,
|
||||
'app_label': 'constance',
|
||||
'opts': self.model._meta,
|
||||
'form': form,
|
||||
'media': self.media + form.media,
|
||||
'icon_type': 'gif' if VERSION < (1, 9) else 'svg',
|
||||
}
|
||||
context = dict(
|
||||
admin.site.each_context(request),
|
||||
config_values=[],
|
||||
title=self.model._meta.app_config.verbose_name,
|
||||
app_label='constance',
|
||||
opts=self.model._meta,
|
||||
form=form,
|
||||
media=self.media + form.media,
|
||||
icon_type='gif' if VERSION < (1, 9) else 'svg',
|
||||
)
|
||||
for name, options in settings.CONFIG.items():
|
||||
context['config_values'].append(
|
||||
self.get_config_value(name, options, form, initial)
|
||||
|
|
|
|||
Loading…
Reference in a new issue