Skip to content

Refactor redirects code #6405

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

Closed
humitos opened this issue Nov 25, 2019 · 1 comment · Fixed by #10881
Closed

Refactor redirects code #6405

humitos opened this issue Nov 25, 2019 · 1 comment · Fixed by #10881
Labels
Accepted Accepted issue on our roadmap Improvement Minor improvement to code Sprintable Small enough to sprint on
Milestone

Comments

@humitos
Copy link
Member

humitos commented Nov 25, 2019

After merging #6398 there are some Python logic code that can be almost completely deleted (redirects.models.Redirect.redirect_* methods).

Besides, as Eric mentioned we can also remove the dependency of passing some attributes to redirects.querysets.RedirectQuerySetBase.get_redirect_path_with_status

@humitos humitos added Improvement Minor improvement to code Accepted Accepted issue on our roadmap labels Nov 25, 2019
@humitos humitos added this to the Refactoring milestone Nov 25, 2019
@humitos humitos self-assigned this Nov 25, 2019
@humitos
Copy link
Member Author

humitos commented Nov 28, 2019

@ericholscher I took a look at this today.

I'm not sure we can remove the lang_slug and version_slug from that method. It's used for resolve_path to get the full path to redirect to.

On the other hand, my idea of removing the redirect_* method may not be possible either. There are some Python logic there (like re.sub to remove a part of the URL) that I don't think we can easily move into the DB or if it does make sense. I think we can only remove some if checks, but not too much more than that.

Let me know if there are something that I'm not seeing here.

@humitos humitos added the Sprintable Small enough to sprint on label Jan 25, 2020
@humitos humitos removed their assignment Jun 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Accepted issue on our roadmap Improvement Minor improvement to code Sprintable Small enough to sprint on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant