Open ivanov17 opened 10 months ago
You can do this with the setting INVITATIONS_INVITATION_ONLY
, which depends on django-allauth
. Are you saying that you need a solution that works without allauth
?
Sorry, I solved this issue but forgot to write about it. Yes, I needed a solution that works without the allauth
package.
A session variable named account_verified_email
is created when the invitation is accepted:
So, there is no dependency on adapter provided by allauth
. And I can use the following method to check the variable:
Before this I also check that the user is not authenticated and registration is allowed. If the checks fail, I simply redirect the user to the login page.
So, there is no problem, and we can close this topic. But I think it would be useful to somehow reflect this in the documentation.
Hello,
I want to use
django-invitations
package to allow current website users to invite new ones. But at the same time, I want to allow access to the registration form only to those visitors who follow the invitation link. Other visitors (registered or unregistered) should not have access to the registration form page. In short, it should be something like a private club.The first thing that comes to mind is to use Django sessions for this. But it looks like
django-invitations
does not create any session variable when accepting an invitation unless the adapter fordjango-allauth
is used.I think sending a session variable with a known name when the corresponding settings variable is set or even by default could be a very useful feature for cases like mine.
Or maybe there is a more obvious solution to this problem?
Thank you.