X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/003b3eecdce065c16cf0e3af23763ae735d4e4ef..55d94d75dff5d3a30dd0cce7554e68d23627376d:/src/club/models.py?ds=sidebyside diff --git a/src/club/models.py b/src/club/models.py index c40428def..77154954b 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)