mirror of
https://github.com/ae-utbm/sith.git
synced 2026-10-11 13:16:09 +00:00
Add groups, allow to ban users from counters and from buying alcohol
This commit is contained in:
1 parent
1c97c8a74f
commit
2daaf992f2
8 files changed
+155
-163
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user