Skip to content

Conversation

Flimm
Copy link
Contributor

@Flimm Flimm commented Apr 7, 2025

Fixes #252

This library has been designed to keep Invitation instances in the database, even after the invitation has been accepted and the user account has been created. The only reason to keep these invitations around is to have a track record of invitations. It seems likely in that case that the inviter would want to be able to interact with the new user account, depending on the application. They may want to visit their profile page or something.

Before this commit, this was impossible to do, as there was nothing linking the invitation instance to a user instance. At first glance, it might seem that an email address would link both models, but that is not the case. A user is not obligated to sign up with the same email address that was used to invite them. Even if they do use the same email address, they may change their email address in their user account later on. So an email address could not be relied on to link these two models.

This commit modifies the modify to add a new field: "invitee". It sets this field after signup. This requires that allauth be installed.

I would like some feedback on this pull request before merging it with to master. In particular, I'm interested in someone testing this code in a project integrating django-invitations.

This library has been designed to keep Invitation instances in the
database, even after the invitation has been accepted and the user
account has been created. The only reason to keep these invitations
around is to have a track record of invitations. It seems likely in that
case that the inviter would want to be able to interact with the new
user account, depending on the application. They may want to visit their
profile page or something.

Before this commit, this was impossible to do, as there was nothing
linking the invitation instance to a user instance. At first glance, it
might seem that an email address would link both models, but that is not
the case. A user is not obligated to sign up with the same email address
that was used to invite them. Even if they do use the same email
address, they may change their email address in their user account later
on. So an email address could not be relied on to link these two models.

This commit modifies the modify to add a new field: "invitee". It sets
this field after signup. This requires that allauth be installed.

Fixes jazzband#252
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proposal: add invitee field to AbstractBaseInvitation model

1 participant