accepting membership fixes

- don't delete the invitation twice
- send membership information properly to notification
This commit is contained in:
Hugh Rundle 2021-10-02 12:29:01 +10:00
parent 9290655116
commit 89dea44614

View file

@ -132,11 +132,11 @@ class GroupMemberInvitation(models.Model):
with transaction.atomic():
BookwyrmGroupMember.from_request(self)
self.delete()
# let the other members know about it
model = apps.get_model("bookwyrm.Notification", require_ready=True)
for member in self.group.members.all:
for membership in self.group.memberships.all():
member = membership.user
if member != self.user:
model.objects.create(
user=member,