Cleanup code style

This commit is contained in:
Iacopo Spalletti 2018-01-18 23:00:00 +01:00
parent 6205c62709
commit f5b3780600
No known key found for this signature in database
GPG key ID: BDCBC2EB289F60C6

View file

@ -9,6 +9,7 @@ from django.contrib.auth import get_user_model
from django.core.exceptions import ImproperlyConfigured
from django.core.urlresolvers import reverse
from django.http import Http404
from django.shortcuts import get_object_or_404
from django.utils.timezone import now
from django.utils.translation import get_language
from django.views.generic import DetailView, ListView
@ -16,7 +17,6 @@ from parler.views import TranslatableSlugMixin, ViewUrlMixin
from .models import BlogCategory, Post
from .settings import get_setting
from django.shortcuts import get_object_or_404
User = get_user_model()
@ -167,8 +167,10 @@ class AuthorEntriesView(BaseBlogListView, ListView):
return self.optimize(qs)
def get_context_data(self, **kwargs):
kwargs['author'] = get_object_or_404(User,
**{User.USERNAME_FIELD: self.kwargs.get('username')})
kwargs['author'] = get_object_or_404(
User,
**{User.USERNAME_FIELD: self.kwargs.get('username')}
)
context = super(AuthorEntriesView, self).get_context_data(**kwargs)
return context