1
0
mirror of https://github.com/django/django.git synced 2025-03-06 07:22:32 +00:00

Used model's Options.model_name instead of object_name.lower().

Follow up to 20d487c27b40bb70496ddc7419011ca78b7d4940.
This commit is contained in:
Mariusz Felisiak 2023-12-14 09:23:12 +01:00 committed by GitHub
parent 0eaad0bb59
commit 2190096f50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -32,7 +32,7 @@ class InclusionAdminNode(InclusionNode):
def render(self, context):
opts = context["opts"]
app_label = opts.app_label.lower()
object_name = opts.object_name.lower()
object_name = opts.model_name
# Load template for this render call. (Setting self.filename isn't
# thread-safe.)
context.render_context[self] = context.template.engine.select_template(

View File

@ -202,7 +202,7 @@ class ForeignKeyRawIdWidget(forms.TextInput):
% (
self.admin_site.name,
obj._meta.app_label,
obj._meta.object_name.lower(),
obj._meta.model_name,
),
args=(obj.pk,),
)