mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-11 04:19:25 +00:00
Add of restriction for refilling
This commit is contained in:
@ -39,7 +39,7 @@ import os
|
||||
import base64
|
||||
import datetime
|
||||
|
||||
from club.models import Club
|
||||
from club.models import Club, Membership
|
||||
from accounting.models import CurrencyField
|
||||
from core.models import Group, User, Notification
|
||||
from subscription.models import Subscription
|
||||
@ -342,6 +342,14 @@ class Counter(models.Model):
|
||||
"""
|
||||
return [b.id for b in self.get_barmen_list()]
|
||||
|
||||
def can_refill(self):
|
||||
is_ae_member = False
|
||||
ae = Club.objects.get(unix_name="ae")
|
||||
for barman in self.get_barmen_list():
|
||||
if Membership.objects.filter(club=ae, user=barman):
|
||||
is_ae_member = True
|
||||
return is_ae_member
|
||||
|
||||
|
||||
class Refilling(models.Model):
|
||||
"""
|
||||
|
Reference in New Issue
Block a user