1
0
mirror of https://github.com/django/django.git synced 2025-04-03 13:06:49 +00:00

fixed linting issues

This commit is contained in:
AP Jama 2023-08-05 12:46:20 +01:00
parent d8cb58ada8
commit 0d971ab7ca
2 changed files with 6 additions and 4 deletions

View File

@ -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:

View File

@ -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,