Fix Bug: select_for_update cannot be used outside of a transaction.

Brightcells 6 lat temu
rodzic
commit
16638b00b5
1 zmienionych plików z 2 dodań i 0 usunięć
  1. 2 0
      api/mch_views.py

+ 2 - 0
api/mch_views.py

@@ -4,6 +4,7 @@ from __future__ import division
4 4
 
5 5
 from django.conf import settings
6 6
 from django.contrib.auth.hashers import check_password
7
+from django.db import transaction
7 8
 from django_logit import logit
8 9
 from django_response import response
9 10
 from pywe_miniapp import get_phone_number
@@ -203,6 +204,7 @@ def consumer_phone_api(request):
203 204
 
204 205
 
205 206
 @logit(res=True)
207
+@transaction.atomic
206 208
 def consumer_info_api(request):
207 209
     user_id = request.POST.get('user_id', '')
208 210
     iv = request.POST.get('iv', '')