Fix download-file-attachment URL for attachments on a local site.

Review Request #14226 — Created Nov. 4, 2024 and submitted — Latest diff uploaded

Information

Review Board
release-7.x

Reviewers

FileAttachment has a confusing relation to LocalSite. For historical
reasons, attachments which are related to a review request have a blank
local_site field, using the review request's local site instead. The
local_site field is therefore only "usable" for user file attachments
(such as files which are dropped into a comment box or review request
field).

This was causing a crash for review requests with attachments when
attempting to create the new download URL.

This change adds a fix for the URL crash, a big comment on the
local_site field explaining what's up, and some unit tests to ensure
that get_absolute_url() does the right thing.

  • Was able to view a review request with attachments on the new RBC
    server.
  • Ran unit tests.

Commits

Files