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

Fixed #22486 -- Reverse raises AttributeError on partial functions. #2601

Closed
wants to merge 1 commit into from
Closed

Fixed #22486 -- Reverse raises AttributeError on partial functions. #2601

wants to merge 1 commit into from

Conversation

prestontimmons
Copy link
Contributor

Create the lookup_str from the original function whenever a partial
is provided as an argument to a url pattern.

@@ -270,6 +270,9 @@ def _populate(self):
self._callback_strs.add(pattern._callback_str)
elif hasattr(pattern, '_callback'):
callback = pattern._callback
if hasattr(callback, 'func'):
Copy link
Member

Choose a reason for hiding this comment

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

would isinstance(calback, functools.partial) be better?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point. That's more explicit than using duck-typing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Commit updated.

Create the lookup_str from the original function whenever a partial
is provided as an argument to a url pattern.
@timgraham
Copy link
Member

merged in 3c06b2f, thanks!

@timgraham timgraham closed this Apr 23, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants