django-lazysignup icon indicating copy to clipboard operation
django-lazysignup copied to clipboard

Ability to use allow_lazy_user with class methods

Open reeteshranjan opened this issue 8 years ago • 3 comments

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.

reeteshranjan avatar Jul 28 '16 14:07 reeteshranjan

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!

danfairs avatar Aug 11 '16 15:08 danfairs

(Oh - and sorry for the delay - all my GH notifications are going astray at the moment, and I'm trying to figure out why...)

danfairs avatar Aug 11 '16 15:08 danfairs

I would soon come back with the refactored version and tests. Thanks for your response!

reeteshranjan avatar Aug 25 '16 03:08 reeteshranjan