Allow order change

This commit is contained in:
Raphael Michel
2019-09-19 17:54:05 +02:00
parent e97ae04581
commit 9842fcf7da
4 changed files with 83 additions and 14 deletions

View File

@@ -61,6 +61,9 @@ class GiftCard(LoggedModel):
def value(self):
return self.transactions.aggregate(s=Sum('value'))['s'] or Decimal('0.00')
def accepted_by(self, organizer):
return self.issuer == organizer or GiftCardAcceptance.objects.filter(issuer=self.issuer, collector=organizer).exists()
class Meta:
unique_together = (('secret', 'issuer'),)