Files
app-store-optimization/skills/loki-mode/benchmarks/results/2026-01-05-01-24-17/swebench-patches/django__django-14855.patch

23 lines
1022 B
Diff

Based on the issue description and the hints provided, I can create the patch. The issue clearly states:
1. The problem is in `django.contrib.admin.helpers` in the `get_admin_url` function
2. The line `url = reverse(url_name, args=[quote(remote_obj.pk)])` needs to be changed to include `current_app=self.model_admin.admin_site.name`
3. This was confirmed as the correct fix in the discussion
Here's the patch:
--- a/django/contrib/admin/helpers.py
+++ b/django/contrib/admin/helpers.py
@@ -209,7 +209,11 @@ class AdminReadonlyField:
remote_obj.pk,
)
try:
- url = reverse(url_name, args=[quote(remote_obj.pk)])
+ url = reverse(
+ url_name,
+ args=[quote(remote_obj.pk)],
+ current_app=self.model_admin.admin_site.name,
+ )
return format_html('<a href="{}">{}</a>', url, remote_obj)
except NoReverseMatch:
return str(remote_obj)