impression_canon: calcule le prix à la fin
C'est un calcul en plus, pour être sûr de facturer le bon prix. Enfin, la race condition pourrait toujours arriver.
This commit is contained in:
parent
f657e57a0d
commit
cb9dda8c7a
1 changed files with 1 additions and 0 deletions
|
@ -390,6 +390,7 @@ class impression:
|
|||
if len(adh) > 1:
|
||||
adh = adh[1:]
|
||||
adh = self._get_adh(adh[0])
|
||||
self._calcule_prix() # Normalement inutile, mais évite les races
|
||||
if (self._prix > (adh.solde() - DECOUVERT_AUTHORISE)):
|
||||
raise SoldeInsuffisant
|
||||
adh.solde(-self._prix, "impression(%d): %s par %s" % (self._jid,self._fichier,self._adh))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue