|
@@ -104,8 +104,14 @@ class AccessLog(View):
|
|
|
if check_perm is True:
|
|
|
try:
|
|
|
content = json.loads(content)
|
|
|
- search_kwargs = CommonService.get_kwargs(data=content)
|
|
|
- queryset = Access_Log.objects.filter(**search_kwargs).order_by(order)
|
|
|
+ kwargs = {}
|
|
|
+ for (k, v) in content.items():
|
|
|
+ if v is not None and v != u'':
|
|
|
+ if k == 'content':
|
|
|
+ kwargs[k + '__icontains'] = v
|
|
|
+ else:
|
|
|
+ kwargs[k] = v
|
|
|
+ queryset = Access_Log.objects.filter(**kwargs).order_by(order)
|
|
|
except Exception as e:
|
|
|
return response.json(444)
|
|
|
if starttime is not None and starttime != '' and endtime is not None and endtime != '':
|