X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/e16f5c5d7985b8e501c6810abf5e540326e392f1..572ee91a188114e383712eac2426dab3bcef6c00:/src/club/models.py?ds=sidebyside diff --git a/src/club/models.py b/src/club/models.py index c40428def..de2d3c62b 100644 --- a/src/club/models.py +++ b/src/club/models.py @@ -161,6 +161,15 @@ class Schedule(models.Model): club = Club.objects.first() return club.get_description_for_amount(self.amount, self.monthly) + def is_custom_amount(self): + club = Club.objects.first() + if not self.amount: + return False + if self.monthly: + return not club.monthlyamount_set.filter(amount=self.amount).exists() + else: + return not club.singleamount_set.filter(amount=self.amount).exists() + def initiate_payment(self, request): return self.get_payment_method().initiate(request, self) @@ -505,6 +514,8 @@ class PayUOrder(payu_models.Order): receipt = cls.generate_receipt(email, year) if receipt: content, optout, payments = receipt + else: + return ctx = { "email": email, "year": year,