You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is not clear to me how one determines the number of remaining invites a user has. The method remaining_invites subtracts invited_users.count() from max_invites, so that only accepted invites will be taken into account. What if you want to limit a users invitations whether they are accepted or not?
A better way would be to subtract invitation_set.count() from max_invites, so that all invites, whether accepted or not counts towards a user's total invites sent.
Moreover, one would think that num_invites is always up to date, but it is only updated in the middleware, not upon saving an InvitationCode.
What am I missing?
The text was updated successfully, but these errors were encountered:
Yes on both counts. I put it in as kind of a half-baked idea. But now that the model's been around for a while, it's good to get num_invites to be always correct. I'll try to put in a fix.
+1 for this issue. It would be nice to have a correct count of remaining invites. Updating num_invites when saving an invitation could fix this issue.
I can send a PR for this if we can converge on a fix.
It is not clear to me how one determines the number of remaining invites a user has. The method remaining_invites subtracts invited_users.count() from max_invites, so that only accepted invites will be taken into account. What if you want to limit a users invitations whether they are accepted or not?
A better way would be to subtract invitation_set.count() from max_invites, so that all invites, whether accepted or not counts towards a user's total invites sent.
Moreover, one would think that num_invites is always up to date, but it is only updated in the middleware, not upon saving an InvitationCode.
What am I missing?
The text was updated successfully, but these errors were encountered: