HF RL Explorer

Wrong URL generated by get admin url for readonly field in custom Admin Site Description

Wrong URL generated by get admin url for readonly field in custom Admin Site Description: a task in Lego-RL-SWE-Bench-Verified (Harbor dataset). When a model containing a ForeignKey field is viewed (or edited) in a custom Admin Site, and that ForeignKey field is listed in readonly fields, the url…

The task

When a model containing a ForeignKey field is viewed (or edited) in a custom Admin Site, and that ForeignKey field is listed in readonly_fields, the url generated for the link is /admin/... instead of /custom-admin/.... This appears to be caused by the following line in django.contrib.admin.helpers get_admin_url: url…

Part of Lego-X/Lego-RL-SWE-Bench-Verified.