django-lazysignup
django-lazysignup copied to clipboard
Ability to use allow_lazy_user with class methods
The allow_lazy_user
decorator is not designed to be used with class methods that prevents one from using it with class based views. We have added a new decorator allow_lazy_user_method
that accepts the instance/self as required and propagates it through the wrap logic. We have used this version in our project successfully where we needed lazy signup to work with a django rest framework view class.
Thanks for your PR! Two comments, really:
- Could you refactor the PR to avoid all the duplicated code? Most of that new code is the same as
allow_lazy_user
. Pull that out into a shared function. - It'd be awesome to have a test, too! Verifying that your method decorator correctly invoked the new shared function would probably be enough, as that existing code is tested elsewhere.
Thanks!
(Oh - and sorry for the delay - all my GH notifications are going astray at the moment, and I'm trying to figure out why...)
I would soon come back with the refactored version and tests. Thanks for your response!