mirror of
https://github.com/ae-utbm/sith.git
synced 2025-11-25 06:06:56 +00:00
Merge pull request #1256 from ae-utbm/remove-is_validated
Database optimisations on counter
This commit is contained in:
@@ -136,7 +136,10 @@ class GetUserForm(forms.Form):
|
||||
|
||||
|
||||
class RefillForm(forms.ModelForm):
|
||||
allowed_refilling_methods = ["CASH", "CARD"]
|
||||
allowed_refilling_methods = [
|
||||
Refilling.PaymentMethod.CASH,
|
||||
Refilling.PaymentMethod.CARD,
|
||||
]
|
||||
|
||||
error_css_class = "error"
|
||||
required_css_class = "required"
|
||||
@@ -146,7 +149,7 @@ class RefillForm(forms.ModelForm):
|
||||
|
||||
class Meta:
|
||||
model = Refilling
|
||||
fields = ["amount", "payment_method", "bank"]
|
||||
fields = ["amount", "payment_method"]
|
||||
widgets = {"payment_method": forms.RadioSelect}
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
@@ -160,9 +163,6 @@ class RefillForm(forms.ModelForm):
|
||||
if self.fields["payment_method"].initial not in self.allowed_refilling_methods:
|
||||
self.fields["payment_method"].initial = self.allowed_refilling_methods[0]
|
||||
|
||||
if "CHECK" not in self.allowed_refilling_methods:
|
||||
del self.fields["bank"]
|
||||
|
||||
|
||||
class CounterEditForm(forms.ModelForm):
|
||||
class Meta:
|
||||
|
||||
Reference in New Issue
Block a user