Add groups, allow to ban users from counters and from buying alcohol

This commit is contained in:
2016-10-16 03:45:06 +02:00
parent 1c97c8a74f
commit 2daaf992f2
8 changed files with 155 additions and 163 deletions

View File

@ -284,6 +284,9 @@ class CounterClick(CounterTabsMixin, DetailView):
if product.limit_age >= 18 and self.customer.user.is_banned_alcohol:
request.session['not_allowed'] = True
return False
if self.customer.user.is_banned_counter:
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