Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix detail url #369

Merged
merged 4 commits into from
Aug 29, 2024
Merged

Fix detail url #369

merged 4 commits into from
Aug 29, 2024

Conversation

HawkiesZA
Copy link
Contributor

@HawkiesZA HawkiesZA commented Aug 28, 2024

Purpose

The detail_url in the Pages API is currently showing the current URL and not the detail URL, which causes a failure on one of our implementations.

Solution

We use get_object_detail_url to get the correct detail url for the Page. Trying to use super() and building on that doesn't work, as it seems to cause a cascade of errors when Assessments serialize a Page.

Checklist

  • Added or updated unit tests
  • Added to release notes
  • Updated readme/documentation (if necessary)

@HawkiesZA HawkiesZA self-assigned this Aug 28, 2024
assert (
meta["detail_url"]
== f"http://localhost/api/v2/pages/{self.low_result_page.id}/"
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we maybe have one test that just asserts the entire response? That way we can make sure none of the other meta fields have incorrect values, and we can ensure that future changes don't change the API?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

rudigiesler
rudigiesler previously approved these changes Aug 28, 2024
@HawkiesZA HawkiesZA merged commit eda8608 into main Aug 29, 2024
2 checks passed
@HawkiesZA HawkiesZA deleted the fix-detail-html branch August 29, 2024 09:07
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.

2 participants