Bind GuestTransaction to entry rather than guest (fix OneToOneField)

This commit is contained in:
Yohann D'ANELLO 2020-07-22 21:05:25 +02:00
parent a098f70424
commit e3045522d1
2 changed files with 4 additions and 3 deletions

View File

@ -163,7 +163,7 @@ class Entry(models.Model):
amount=self.activity.activity_type.guest_entry_fee,
reason="Invitation " + self.activity.name + " " + self.guest.first_name + " " + self.guest.last_name,
valid=True,
guest=self.guest,
entry=self,
).save()
return ret
@ -240,8 +240,8 @@ class Guest(models.Model):
class GuestTransaction(Transaction):
guest = models.OneToOneField(
Guest,
entry = models.OneToOneField(
Entry,
on_delete=models.PROTECT,
)

View File

@ -2,6 +2,7 @@
envlist =
py36-django22
py37-django22
py38-django22
linters
skipsdist = True