diff --git a/django/contrib/admin/templatetags/log.py b/django/contrib/admin/templatetags/log.py index 856e8f0eeb..3e2111b8bd 100644 --- a/django/contrib/admin/templatetags/log.py +++ b/django/contrib/admin/templatetags/log.py @@ -20,8 +20,8 @@ class AdminLogNode(template.Node): user_id = context[self.user].pk entries = entries.filter(user__pk=user_id) filtered_context = entries.select_related("content_type", "user")[ - : int(self.limit) - ] + : int(self.limit) + ] for entry in filtered_context: content_type = entry.content_type if not content_type: diff --git a/tests/admin_utils/test_logentry.py b/tests/admin_utils/test_logentry.py index a64adc1d56..83faddcc23 100644 --- a/tests/admin_utils/test_logentry.py +++ b/tests/admin_utils/test_logentry.py @@ -3,7 +3,7 @@ from datetime import datetime from django.contrib.admin.models import ADDITION, CHANGE, DELETION, LogEntry from django.contrib.admin.utils import quote -from django.contrib.auth.models import User, Permission +from django.contrib.auth.models import Permission, User from django.contrib.contenttypes.models import ContentType from django.test import TestCase, override_settings from django.urls import reverse @@ -359,7 +359,9 @@ class LogEntryTests(TestCase): # Add permission to view articles. Log is a link. logentry = LogEntry.objects.get(content_type__model__iexact="article") - view_permission_name = f"{logentry.content_type.app_label}.view_{logentry.content_type.model}" + view_permission_name = ( + f"{logentry.content_type.app_label}.view_{logentry.content_type.model}" + ) view_article_permission = Permission.objects.create( name=f"Can view {logentry.content_type.model}", content_type=logentry.content_type,