bennylope / django-organizations

:couple: Multi-user accounts for Django projects

Home Page:http://django-organizations.readthedocs.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

_num_days attribute does not exist on RegistrationTokenGenerator

leon-tnvm opened this issue · comments

When calling check_token() on RegistrationTokenGenerator, an error is thrown because the function uses _num_days which does not exist on RegistrationTokeneGenerator or the base class PasswordResetTokenGenerator.

This is it, line 67-69 of organizations/backends/token.py:

        # Check the timestamp is within limit
        if (self._num_days(self._today()) - ts) > REGISTRATION_TIMEOUT_DAYS:
            return False

Perhaps num_days was deprecated and this not updated?

This is on Python3.8 running django3.1 and django-organizations-1.1.2

The custom token generator was removed in 57277d2. If someone provides a patch I could make a bug fix for the 1.x version, otherwise I'd recommend extending the backend class to override the token generator.