mirror of
https://github.com/nanoy42/coope
synced 2024-12-23 15:33:45 +00:00
commit
63363c9219
2 changed files with 6 additions and 1 deletions
|
@ -11,7 +11,7 @@ from coopeV3.widgets import SearchField
|
|||
class ReloadForm(forms.ModelForm):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(ReloadForm, self).__init__(*args, **kwargs)
|
||||
self.fields['PaymentMethod'].queryset = PaymentMethod.objects.filter(is_usable_in_reload=True)
|
||||
self.fields['PaymentMethod'].queryset = PaymentMethod.objects.filter(is_usable_in_reload=True).filter(is_active=True)
|
||||
|
||||
class Meta:
|
||||
model = Reload
|
||||
|
|
|
@ -2,6 +2,7 @@ from django import forms
|
|||
from django.contrib.auth.models import User, Group
|
||||
from dal import autocomplete
|
||||
from .models import School, CotisationHistory, WhiteListHistory
|
||||
from preferences.models import PaymentMethod
|
||||
|
||||
class LoginForm(forms.Form):
|
||||
"""
|
||||
|
@ -84,6 +85,10 @@ class addCotisationHistoryForm(forms.ModelForm):
|
|||
"""
|
||||
Form to add a cotisation to user
|
||||
"""
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(addCotisationHistoryForm, self).__init__(*args, **kwargs)
|
||||
self.fields['paymentMethod'].queryset = PaymentMethod.objects.filter(is_usable_in_cotisation=True).filter(is_active=True)
|
||||
|
||||
class Meta:
|
||||
model = CotisationHistory
|
||||
fields = ("cotisation", "paymentMethod")
|
||||
|
|
Loading…
Reference in a new issue