Add ban for alcohol

This commit is contained in:
klmp200 committed 2016-10-15 02:33:38 +02:00
1 parent a0319887c8
commit 257cb9cfe7
5 files changed
+40 -4

No files matched your search

+3
View File
@@ -278,6 +278,9 @@ class CounterClick(CounterTabsMixin, DetailView):
if product.limit_age >= 18 and not self.customer.user.date_of_birth:
request.session['no_age'] = True
return False
if product.limit_age >= 18 and self.customer.user.is_banned_alcohol:
request.session['not_allowed'] = True
return False
if self.customer.user.date_of_birth and self.customer.user.get_age() < product.limit_age: # Check if affordable
request.session['too_young'] = True
return False