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

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