diff options
| author | Tim Graham <timograham@gmail.com> | 2016-03-28 18:33:29 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-04-08 09:51:06 -0400 |
| commit | df8d8d4292684d6ffa7474f1e201aed486f02b53 (patch) | |
| tree | c661bf9b33de5288afe4f63347a2a9c768ef98eb /django/contrib/admin/sites.py | |
| parent | 2956e2f5e3f63d279f5dae2a995265364d3e6db1 (diff) | |
Fixed E128 flake8 warnings in django/.
Diffstat (limited to 'django/contrib/admin/sites.py')
| -rw-r--r-- | django/contrib/admin/sites.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/django/contrib/admin/sites.py b/django/contrib/admin/sites.py index ba9cbcc135..d867aacbc1 100644 --- a/django/contrib/admin/sites.py +++ b/django/contrib/admin/sites.py @@ -84,8 +84,9 @@ class AdminSite(object): model_or_iterable = [model_or_iterable] for model in model_or_iterable: if model._meta.abstract: - raise ImproperlyConfigured('The model %s is abstract, so it ' - 'cannot be registered with admin.' % model.__name__) + raise ImproperlyConfigured( + 'The model %s is abstract, so it cannot be registered with admin.' % model.__name__ + ) if model in self._registry: raise AlreadyRegistered('The model %s is already registered' % model.__name__) @@ -362,7 +363,8 @@ class AdminSite(object): # it cannot import models from other applications at the module level, # and django.contrib.admin.forms eventually imports User. from django.contrib.admin.forms import AdminAuthenticationForm - context = dict(self.each_context(request), + context = dict( + self.each_context(request), title=_('Log in'), app_path=request.get_full_path(), ) @@ -479,8 +481,7 @@ class AdminSite(object): request.current_app = self.name - return TemplateResponse(request, self.index_template or - 'admin/index.html', context) + return TemplateResponse(request, self.index_template or 'admin/index.html', context) def app_index(self, request, app_label, extra_context=None): app_dict = self._build_app_dict(request, app_label) @@ -489,7 +490,8 @@ class AdminSite(object): # Sort the models alphabetically within each app. app_dict['models'].sort(key=lambda x: x['name']) app_name = apps.get_app_config(app_label).verbose_name - context = dict(self.each_context(request), + context = dict( + self.each_context(request), title=_('%(app)s administration') % {'app': app_name}, app_list=[app_dict], app_label=app_label, |
