Skip to content

Conversation

@adlius
Copy link
Collaborator

@adlius adlius commented Nov 12, 2025

Purpose

Currently, if a preprint have more than one version, the guids endpoint will always redirect to the latest version even if we specify the version number in the guid. This is because the get_redirect_url() hook in GuidDetail will try to return the referent's absolute_api_v2_url property, which for preprint is based on self._id. Preprint inherits from the VersionedGuidMixin which overrides the _id property to always return guid string with the latest version.

This fix specifies a get_versioned_absolute_api_v2_url in the VersionedGuidMixin base class and implements the method in the Preprint model class.

Changes

QA Notes

Please make verification statements inspired by your code and what your code touches.

  • Verify
  • Verify

What are the areas of risk?

Any concerns/considerations/questions that development raised?

Documentation

Side Effects

Ticket

Copy link
Collaborator

@cslzchen cslzchen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 🎆

Nitpick: I see this is an hotfix but if we have time, let's add unit tests to test our changes to get_redirect_url and the newly added get_versioned_absolute_api_v2_url.

In addition, looks like we have linting error that needs to be fixed.

@adlius adlius changed the base branch from master to hotfix/25.17.11 November 14, 2025 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants