Commit 34657e6a authored by gaoming's avatar gaoming

good morning

parent ef0f5eda
......@@ -74,7 +74,7 @@ class PromotionChannel(models.Model):
keys=kwargs.keys()
#查找存在表中的字段
params={key:value for key,value in kwargs.items() if key in propertys}
params={key.lower().strip():value for key,value in kwargs.items() if key.lower().strip() in propertys}
#获得request的数据
if request:
......@@ -92,7 +92,6 @@ class PromotionChannel(models.Model):
try:
promotion= PromotionChannel.objects.create(**params)
except Exception as e:
#字典转字符串
print(str(e))
return False,CHANNEL_STATUS.ADD_FAIL_GENERAL
......
......@@ -123,7 +123,10 @@ class Statistic(View):
return JsonResponse({'error':0, 'msg':''})
class DoubleCheck(View):
'''
查重复
'''
......@@ -138,7 +141,12 @@ class Channel(View):
platform=request.path.split('/')[2]
#获得渠道数据
data=Channel.__dict__.get(platform)(self)
try:
data=Channel.__dict__.get(platform)(self)
except Exception as e:
print(str(e))
return JsonResponse({'code':1,'failMsg':"not exists method to handle it!"})
result,msg=PromotionChannel.record(request,**data)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment