mirror of https://gitlab.crans.org/bde/nk20
Bind GuestTransaction to entry rather than guest (fix OneToOneField)
This commit is contained in:
parent
a098f70424
commit
e3045522d1
|
@ -163,7 +163,7 @@ class Entry(models.Model):
|
||||||
amount=self.activity.activity_type.guest_entry_fee,
|
amount=self.activity.activity_type.guest_entry_fee,
|
||||||
reason="Invitation " + self.activity.name + " " + self.guest.first_name + " " + self.guest.last_name,
|
reason="Invitation " + self.activity.name + " " + self.guest.first_name + " " + self.guest.last_name,
|
||||||
valid=True,
|
valid=True,
|
||||||
guest=self.guest,
|
entry=self,
|
||||||
).save()
|
).save()
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
@ -240,8 +240,8 @@ class Guest(models.Model):
|
||||||
|
|
||||||
|
|
||||||
class GuestTransaction(Transaction):
|
class GuestTransaction(Transaction):
|
||||||
guest = models.OneToOneField(
|
entry = models.OneToOneField(
|
||||||
Guest,
|
Entry,
|
||||||
on_delete=models.PROTECT,
|
on_delete=models.PROTECT,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue