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 URLRouter compatibility with Django main #2085

Merged
merged 1 commit into from
Mar 29, 2024
Merged

Conversation

adamchainz
Copy link
Member

@adamchainz adamchainz commented Mar 28, 2024

Fixes #2084.

See discussion on related Django ticket.

arg = pattern._route
else:
raise ValueError(f"Unsupported pattern type: {type(pattern)}")
route.pattern = pattern.__class__(arg, pattern.name, is_endpoint=False)
Copy link
Member Author

Choose a reason for hiding this comment

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

using pattern.__class__ to support subclasses, just in case someone is using them...

Copy link
Member

@carltongibson carltongibson left a comment

Choose a reason for hiding this comment

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

Lovely. Thanks @adamchainz 🐣

@carltongibson carltongibson merged commit ecbf353 into main Mar 29, 2024
6 checks passed
@carltongibson carltongibson deleted the issue_2084 branch March 29, 2024 07:08
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.

Breakage in routing.py on django/main pre-5.1.
2 participants