-
Notifications
You must be signed in to change notification settings - Fork 23
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: Remove get_absolute_url
from both Alias
and AliasContent
models
#199
Conversation
# Conflicts: # tests/test_models.py
for more information, see https://pre-commit.ci
…-alias into fix/remove_get_abs_url # Conflicts: # tests/test_admin.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be left behind from where previously there was a custom admin UI solution for managing Alias. We opted sometime ago to use the native django admin like the other packages do.
The one exception to the point that you make on the fact that Alias are not viewable outright is that the toolbar does treat them as individually viewable items. I'd check that the toolbar continues to function for Alias with regards to editing an Alias. If this works fine then I see no issue removing.
Some of the tests that have been changed could be regression, the side frame actiona removal and also the fact that the alias does have a complex matrix of when to show draft and live content in the page edit mode. The absolute url could drive that although it's been some time since I worked / looked at that code.
@Aiky30 Preview and edit endpoints are not affected by the PR, of course. And they continue to work. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only other thing I can think of regarding this change is a strange matrix of scenarios that exist when trying to render an Alias. I think it went:
Draft Page renders Draft Alias
Preview Page renders Draft Alias
Published Page renders Published Alias
I'm not sure if the get absolute url was used for this mechanism. I'm so far away from the CMS these days that I'm not much use.
I know that FIL internal codebase depends on this so people may want this to be investigated further.
…-alias into fix/remove_get_abs_url
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Description
According to the Django docs, get_absolute_url should calculate the canonical URL of an object. I argue that aliases should not have a canonical URL, since
Fixes the invalid edit alias URL in the plugin menu (if no alias is available in the current language).
Related resources
Alias
andAliasContent
objects should not haveget_absoulte_url
methods #188