You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bloodhound.apache.org by rj...@apache.org on 2013/07/15 22:25:48 UTC

svn commit: r1503456 - /bloodhound/trunk/bloodhound_multiproduct/multiproduct/hooks.py

Author: rjollos
Date: Mon Jul 15 20:25:48 2013
New Revision: 1503456

URL: http://svn.apache.org/r1503456
Log:
Fix for `ProductizedHref` throwing an exception when a dictionary is the first argument. Refs #579.

Modified:
    bloodhound/trunk/bloodhound_multiproduct/multiproduct/hooks.py

Modified: bloodhound/trunk/bloodhound_multiproduct/multiproduct/hooks.py
URL: http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_multiproduct/multiproduct/hooks.py?rev=1503456&r1=1503455&r2=1503456&view=diff
==============================================================================
--- bloodhound/trunk/bloodhound_multiproduct/multiproduct/hooks.py (original)
+++ bloodhound/trunk/bloodhound_multiproduct/multiproduct/hooks.py Mon Jul 15 20:25:48 2013
@@ -103,10 +103,11 @@ class ProductizedHref(Href):
         self._global_href = global_href
 
     def __call__(self, *args, **kwargs):
-        if args:
+        if args and isinstance(args[0], basestring):
             if args[0] in self.PATHS_NO_TRANSFORM or \
-               (len(args) == 1 and args[0] == 'admin') or \
-               filter(lambda x: args[0].startswith(x), self.STATIC_PREFIXES):
+                    (len(args) == 1 and args[0] == 'admin') or \
+                    filter(lambda x: args[0].startswith(x),
+                           self.STATIC_PREFIXES):
                 return self._global_href(*args, **kwargs)
         return self.super.__call__(*args, **kwargs)