Specify the URL for users when recording ChangeDescription entries.

Review Request #14410 — Created April 29, 2025 and submitted — Latest diff uploaded

Information

Review Board
release-7.1.x

Reviewers

When recording ChangeDescription entries for a change in ownership on
a review request, we rely on User.get_absolute_url(). This is defined
globally for users via settings.ABSOLUTE_URL_OVERRIDES, but the value
doesn't take into account Local Sites, and on RBCommons we don't have
this set at all, meaning this function is not available on User.

To address this properly, ChangeDescription.record_field_chnage()
now takes an optional build_url_func(), which can be used to let a
caller handle URL computation for the objects. This is specified by
OwnerField to compute a URL relative to the Local Site or global site
for the parent review request.

Removed the ABSOLUTE_URL_OVERRIDES and reproduced the original problem
publishing. Verified that this patch fixed that, and generated a correct
URL for both the global site and Local Site.

Tested this on RBCommons as well.

Commits

Files