settings.CHECK_DUPLOAD_ENABLED

Kimi.Huang 6 years ago
parent
commit
c370a38255
3 changed files with 4 additions and 2 deletions
  1. 1 1
      api/mch_views.py
  2. 2 0
      kodo/settings.py
  3. 1 1
      page/sale_views.py

+ 1 - 1
api/mch_views.py

@@ -292,7 +292,7 @@ def consumer_info_api(request):
292 292
         test_user=user.test_user,
293 293
     )
294 294
 
295
-    if not user.test_user and not dupload:
295
+    if (not settings.CHECK_DUPLOAD_ENABLED) or (not user.test_user and not dupload):
296 296
         # TODO: Make statistic async
297 297
         ymd = tc.local_string(format='%Y%m%d')
298 298
 

+ 2 - 0
kodo/settings.py

@@ -389,6 +389,8 @@ DJANGO_WE_COMPONENT_CALLBACK_TEMPLATE = 'page/preauth/preauth_success.html'
389 389
 # Test Settings
390 390
 DEBUG_STATISTIC_DATA_FLAG = False
391 391
 
392
+CHECK_DUPLOAD_ENABLED = True  # 是否启用重复提交校验
393
+
392 394
 KODO_DEFAULT_BRAND_PK = 0
393 395
 KODO_DEFAULT_BRAND_ID = ''
394 396
 KODO_DEFAULT_BRAND_NAME = ''

+ 1 - 1
page/sale_views.py

@@ -156,7 +156,7 @@ def clerk_sale_submit_api(request):
156 156
         )
157 157
 
158 158
     # TODO: Make statistic async
159
-    if not sci:
159
+    if (not settings.CHECK_DUPLOAD_ENABLED) or (not sci):
160 160
         ymd = tc.local_string(format='%Y%m%d')
161 161
 
162 162
         # 日销量统计