Skip to content

Commit

Permalink
Used model's Options.model_name instead of object_name.lower().
Browse files Browse the repository at this point in the history
Follow up to 20d487c.
  • Loading branch information
felixxm authored Dec 14, 2023
1 parent 0eaad0b commit 2190096
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion django/contrib/admin/templatetags/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def __init__(self, parser, token, func, template_name, takes_context=True):
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(
Expand Down
2 changes: 1 addition & 1 deletion django/contrib/admin/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def label_and_url_for_value(self, value):
% (
self.admin_site.name,
obj._meta.app_label,
obj._meta.object_name.lower(),
obj._meta.model_name,
),
args=(obj.pk,),
)
Expand Down

0 comments on commit 2190096

Please sign in to comment.