8025L461">461
@logit
def clerk_writeoff_coupon(request):
brandID = request.POST.get('brand_id', settings.KODO_DEFAULT_BRAND_PK)
@@ -490,7 +493,7 @@ def clerk_writeoff_coupon(request):
try:
user_coupon = UserCouponInfo.objects.get(user_coupon_id=user_coupon_id)
if user_coupon.has_used:
- return response(CouponStatusCode.COUPON_HAS_USED)
+ return response(CouponStatusCode.COUPON_HAS_USED)
elif user_coupon.is_coupon_admin_writeoff:
return response(CouponStatusCode.COUPON_PERMISSION_DENIED)
elif not user_coupon.has_expired:
@@ -502,12 +505,13 @@ def clerk_writeoff_coupon(request):
user_coupon.used_at = tc.utc_datetime()
user_coupon.save()
else:
- return response(CouponStatusCode.COUPON_EXPIRED)
+ return response(CouponStatusCode.COUPON_EXPIRED)
except UserCouponInfo.DoesNotExist:
return response(CouponStatusCode.COUPON_NOT_FOUND)
return response(200, 'Write Off Coupon Success', u'劵核销成功')
+
@logit
def clerk_checkout_serialNo_api(request):
brandID = request.POST.get('brand_id', settings.KODO_DEFAULT_BRAND_PK)
@@ -128,7 +128,7 @@ def pre_new_models(fpath='./pre/static/models_20180816.xls'): |
||
| 128 | 128 |
nrows = sheet.nrows |
| 129 | 129 |
for idx in range(1, nrows): |
| 130 | 130 |
rvals = sheet.row_values(idx) |
| 131 |
- print rvals |
|
| 131 |
+ print(rvals) |
|
| 132 | 132 |
|
| 133 | 133 |
jancode = strip(rvals[0]) |
| 134 | 134 |
if not jancode: |
@@ -159,18 +159,18 @@ def pre_adaptive_cameras(fpath=u'./pre/static/腾龙镜头适用机型V1.xlsx'): |
||
| 159 | 159 |
for sheet in sheets: |
| 160 | 160 |
model_name = sheet.name |
| 161 | 161 |
model_full_name = sheet.row_values(2)[0] |
| 162 |
- print model_name, model_full_name |
|
| 162 |
+ print(model_name, model_full_name) |
|
| 163 | 163 |
nrows = sheet.nrows |
| 164 | 164 |
for idx in range(4, nrows): |
| 165 | 165 |
rvals = sheet.row_values(idx) |
| 166 |
- print rvals |
|
| 166 |
+ print(rvals) |
|
| 167 | 167 |
for val in rvals: |
| 168 | 168 |
val = strip(val) |
| 169 | 169 |
if not val: |
| 170 | 170 |
continue |
| 171 | 171 |
if u'卡口' in val: |
| 172 | 172 |
continue |
| 173 |
- print val |
|
| 173 |
+ print(val) |
|
| 174 | 174 |
ModelCameraBodyInfo.objects.get_or_create( |
| 175 | 175 |
brand_id=settings.KODO_DEFAULT_BRAND_ID, |
| 176 | 176 |
brand_name=settings.KODO_DEFAULT_BRAND_NAME, |
@@ -249,7 +249,7 @@ def refreshs(): |
||
| 249 | 249 |
logs = ConsumeInfoSubmitLogInfo.objects.filter(verifyResult=1, dupload=False, test_user=False) |
| 250 | 250 |
|
| 251 | 251 |
for log in logs: |
| 252 |
- ymd = tc.local_string(tc.to_local_datetime(log.created_at), format='%Y%m%d') |
|
| 252 |
+ ymd = tc.local_string(utc_dt=log.created_at, format='%Y%m%d') |
|
| 253 | 253 |
|
| 254 | 254 |
try: |
| 255 | 255 |
mdl = ModelInfo.objects.get(model_id=log.model_id) |
@@ -329,7 +329,7 @@ def refreshs(): |
||
| 329 | 329 |
'lat': log.lat, |
| 330 | 330 |
'lon': log.lon, |
| 331 | 331 |
'phone': log.phone, |
| 332 |
- 'ymd': tc.local_string(tc.to_local_datetime(log.created_at), format='%Y%m%d'), |
|
| 332 |
+ 'ymd': tc.local_string(utc_dt=log.created_at, format='%Y%m%d'), |
|
| 333 | 333 |
'model_id': log.model_id, |
| 334 | 334 |
'serialNo': log.serialNo |
| 335 | 335 |
}) |
@@ -345,7 +345,7 @@ def refreshs2(): |
||
| 345 | 345 |
logs = SaleclerkSubmitLogInfo.objects.filter(dupload=False, test_user=False, test_sn=False, status=True) |
| 346 | 346 |
|
| 347 | 347 |
for log in logs: |
| 348 |
- ymd = tc.local_string(tc.to_local_datetime(log.created_at), format='%Y%m%d') |
|
| 348 |
+ ymd = tc.local_string(utc_dt=log.created_at, format='%Y%m%d') |
|
| 349 | 349 |
|
| 350 | 350 |
try: |
| 351 | 351 |
brand = BrandInfo.objects.get(pk=log.brand_pk) |
@@ -1,4 +1,4 @@ |
||
| 1 |
-CodeConvert==2.0.5 |
|
| 1 |
+CodeConvert==3.0.2 |
|
| 2 | 2 |
Pillow==5.0.0 |
| 3 | 3 |
StatusCode==1.0.0 |
| 4 | 4 |
TimeConvert==1.5.1 |
@@ -7,7 +7,7 @@ isoweek==1.3.3 |
||
| 7 | 7 |
jsonfield==2.0.2 |
| 8 | 8 |
mock==2.0.0 |
| 9 | 9 |
monetary==1.0.3 |
| 10 |
-mysqlclient==1.4.5 |
|
| 10 |
+mysqlclient==1.4.6 |
|
| 11 | 11 |
pysnippets==1.1.2 |
| 12 | 12 |
qiniu==7.2.6 |
| 13 | 13 |
requests==2.21.0 |
@@ -1,3 +1,3 @@ |
||
| 1 | 1 |
ipdb==0.11 |
| 2 | 2 |
ipython==5.8.0 |
| 3 |
-uwsgi==2.0.17 |
|
| 3 |
+uwsgi==2.0.18 |
@@ -1,9 +1,9 @@ |
||
| 1 |
-Django==1.11.26 |
|
| 1 |
+Django==1.11.29 |
|
| 2 | 2 |
django-admin==2.0.1 |
| 3 | 3 |
django-cors-headers==3.0.2 |
| 4 | 4 |
django-curtail-uuid==1.0.4 |
| 5 | 5 |
django-daterange-filter==1.3.0 |
| 6 |
-django-detect==1.0.17 |
|
| 6 |
+django-detect==1.0.18 |
|
| 7 | 7 |
django-file-md5==1.0.3 |
| 8 | 8 |
django-file-upload==1.1.1 |
| 9 | 9 |
django-ip==1.0.2 |
@@ -8,7 +8,7 @@ pywe-custom-message==1.0.1 |
||
| 8 | 8 |
pywe-miniapp==1.1.5 |
| 9 | 9 |
pywe-oauth==1.1.1 |
| 10 | 10 |
pywe-pay==1.0.13 |
| 11 |
-pywe-pay-notify==1.0.4 |
|
| 11 |
+pywe-pay-notify==1.0.5 |
|
| 12 | 12 |
pywe-response==1.0.1 |
| 13 | 13 |
pywe-sign==1.1.0 |
| 14 | 14 |
pywe-wxa-cv==1.0.0 |
@@ -3,8 +3,8 @@ |
||
| 3 | 3 |
from django.conf import settings |
| 4 | 4 |
from django_redis_connector import connector |
| 5 | 5 |
from pywe_storage import RedisStorage |
| 6 |
-from pywe_user import get_all_users |
|
| 7 | 6 |
|
| 7 |
+from pywe_user import get_all_users |
|
| 8 | 8 |
from utils.redis.rkeys import SUBSCRIBE_USERINFO_LIST |
| 9 | 9 |
|
| 10 | 10 |
|
@@ -15,7 +15,7 @@ WECHAT = settings.WECHAT |
||
| 15 | 15 |
|
| 16 | 16 |
|
| 17 | 17 |
def fetch_users_func(authorizer_appid, infos): |
| 18 |
- print authorizer_appid, infos |
|
| 18 |
+ print(authorizer_appid, infos) |
|
| 19 | 19 |
openids = infos.get('data', {}).get('openid', [])
|
| 20 | 20 |
for openid in openids: |
| 21 | 21 |
r1.rpushjson(SUBSCRIBE_USERINFO_LIST % authorizer_appid, {
|
@@ -3,4 +3,5 @@ from __future__ import unicode_literals |
||
| 3 | 3 |
|
| 4 | 4 |
from django.test import TestCase |
| 5 | 5 |
|
| 6 |
+ |
|
| 6 | 7 |
# Create your tests here. |
@@ -3,4 +3,5 @@ from __future__ import unicode_literals |
||
| 3 | 3 |
|
| 4 | 4 |
from django.shortcuts import render |
| 5 | 5 |
|
| 6 |
+ |
|
| 6 | 7 |
# Create your views here. |
@@ -256,6 +256,7 @@ class PermissionStatusCode(BaseStatusCode): |
||
| 256 | 256 |
""" 4099xx 权限相关错误码 """ |
| 257 | 257 |
PERMISSION_DENIED = StatusCodeField(409900, 'Permission Denied', description=u'权限不足') |
| 258 | 258 |
|
| 259 |
+ |
|
| 259 | 260 |
class CouponStatusCode(BaseStatusCode): |
| 260 | 261 |
""" 4050xx 优惠劵相关错误码 """ |
| 261 | 262 |
COUPON_NOT_FOUND = StatusCodeField(405001, 'Coupon Not Found', description=u'劵不存在') |
@@ -9,7 +9,7 @@ from utils.redis.rkeys import TODAY_INCOME, TOTAL_INCOME, WEEK_INCOME, WEEK_SOLD |
||
| 9 | 9 |
|
| 10 | 10 |
def set_brief_info(uid, ptype, fee, dt=None): |
| 11 | 11 |
""" 更新简报信息 """ |
| 12 |
- ymd, week = (tc.local_string(tc.to_local_datetime(dt), format='%Y%m%d'), Week.withdate(dt)) if dt else (tc.local_string(format='%Y%m%d'), Week.thisweek().isoformat()) |
|
| 12 |
+ ymd, week = (tc.local_string(utc_dt=dt, format='%Y%m%d'), Week.withdate(dt)) if dt else (tc.local_string(format='%Y%m%d'), Week.thisweek().isoformat()) |
|
| 13 | 13 |
|
| 14 | 14 |
# 总收入 |
| 15 | 15 |
r.incr(TOTAL_INCOME % (uid, ptype), fee) |
@@ -41,7 +41,7 @@ def zbar(path): |
||
| 41 | 41 |
def test_zbar(): |
| 42 | 42 |
# In[4]: test_zbar() |
| 43 | 43 |
# [u'189415'] |
| 44 |
- print zbar(settings.TESTING_ZBAR) |
|
| 44 |
+ print(zbar(settings.TESTING_ZBAR)) |
|
| 45 | 45 |
|
| 46 | 46 |
|
| 47 | 47 |
if __name__ == '__main__': |
@@ -28,4 +28,4 @@ def zbar2(path): |
||
| 28 | 28 |
def test_zbar2(): |
| 29 | 29 |
# In[5]: test_zbar() |
| 30 | 30 |
# [u'189415'] |
| 31 |
- print zbar2(settings.TESTING_ZBAR) |
|
| 31 |
+ print(zbar2(settings.TESTING_ZBAR)) |