Protect query on Eboutic to prevend double basket validation

This commit is contained in:
Skia 2016-11-22 17:04:12 +01:00
parent cfbd610305
commit 02be5e1629

View File

@ -180,7 +180,7 @@ class EtransactionAutoAnswer(View):
if request.GET['Error'] == "00000": if request.GET['Error'] == "00000":
try: try:
with transaction.atomic(): with transaction.atomic():
b = Basket.objects.filter(id=request.GET['BasketID']).first() b = Basket.objects.select_for_update().filter(id=request.GET['BasketID']).first()
if b is None: if b is None:
raise SuspiciousOperation("Basket does not exists") raise SuspiciousOperation("Basket does not exists")
i = Invoice() i = Invoice()