mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-10 20:09:25 +00:00
Fix refill permissions
* Remove ability to refill from counters * Fix bug where you could refill without any board member on a BAR * Add a warning message explaining why refilling are disabled
This commit is contained in:
@ -43,7 +43,7 @@ from core.fields import ResizedImageField
|
||||
from core.models import Group, Notification, User
|
||||
from core.utils import get_start_of_semester
|
||||
from counter.apps import PAYMENT_METHOD
|
||||
from sith.settings import SITH_COUNTER_OFFICES, SITH_MAIN_CLUB
|
||||
from sith.settings import SITH_MAIN_CLUB
|
||||
from subscription.models import Subscription
|
||||
|
||||
|
||||
@ -559,9 +559,6 @@ class Counter(models.Model):
|
||||
"""Show if the counter authorize the refilling with physic money."""
|
||||
if self.type != "BAR":
|
||||
return False
|
||||
if self.id in SITH_COUNTER_OFFICES:
|
||||
# If the counter is either 'AE' or 'BdF', refills are authorized
|
||||
return True
|
||||
# at least one of the barmen is in the AE board
|
||||
ae = Club.objects.get(unix_name=SITH_MAIN_CLUB["unix_name"])
|
||||
return any(ae.get_membership_for(barman) for barman in self.barmen_list)
|
||||
|
Reference in New Issue
Block a user