diff options
-rw-r--r-- | passlib/utils/handlers.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/passlib/utils/handlers.py b/passlib/utils/handlers.py index 3636829..f44acbb 100644 --- a/passlib/utils/handlers.py +++ b/passlib/utils/handlers.py @@ -892,7 +892,6 @@ class HasManyIdents(GenericHandler): # create subclasss subcls = super(HasManyIdents, cls).using(**kwds) - assert issubclass(subcls, cls) # add custom default ident if default_ident is not None: @@ -2008,6 +2007,18 @@ class PrefixWrapper(object): wrapped = self.prefix + hash[len(orig_prefix):] return uascii_to_str(wrapped) + def using(self, **kwds): + # generate subclass of wrapped handler + subcls = self.wrapped.using(**kwds) + if subcls is self.wrapped: + return self + # then create identical wrapper which wraps the new subclass. + return PrefixWrapper(self.name, subcls, prefix=self.prefix, orig_prefix=self.orig_prefix) + + def needs_update(self, hash, **kwds): + hash = self._unwrap_hash(hash) + return self.wrapped.needs_update(hash, **kwds) + def identify(self, hash): hash = to_unicode_for_identify(hash) if not hash.startswith(self.prefix): |