mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-12-23 23:43:47 +00:00
Déconfusion entre la personne qui fait l'action et le compte concerné.
This commit is contained in:
parent
25a710395f
commit
db198c46ad
2 changed files with 3 additions and 3 deletions
|
@ -243,12 +243,12 @@ class RechargeForm(FormRevMixin, Form):
|
|||
label=_("Payment method")
|
||||
)
|
||||
|
||||
def __init__(self, *args, user=None, **kwargs):
|
||||
def __init__(self, *args, user=None, user_source, **kwargs):
|
||||
self.user = user
|
||||
super(RechargeForm, self).__init__(*args, **kwargs)
|
||||
self.fields['payment'].empty_label = \
|
||||
_("Select a payment method")
|
||||
self.fields['payment'].queryset = Paiement.find_allowed_payments(user).exclude(is_balance=True)
|
||||
self.fields['payment'].queryset = Paiement.find_allowed_payments(user_source).exclude(is_balance=True)
|
||||
|
||||
def clean(self):
|
||||
"""
|
||||
|
|
|
@ -827,7 +827,7 @@ def credit_solde(request, user, **_kwargs):
|
|||
kwargs={'userid': user.id}
|
||||
))
|
||||
|
||||
refill_form = RechargeForm(request.POST or None, user=user)
|
||||
refill_form = RechargeForm(request.POST or None, user=user, user_source=request.user)
|
||||
if refill_form.is_valid():
|
||||
price = refill_form.cleaned_data['value']
|
||||
invoice = Facture(user=user)
|
||||
|
|
Loading…
Reference in a new issue