diff --git a/apps/enm/views.py b/apps/enm/views.py index 9f45b06d..71fd3e4b 100644 --- a/apps/enm/views.py +++ b/apps/enm/views.py @@ -217,7 +217,8 @@ class MpointStatViewSet(BulkCreateModelMixin, BulkDestroyModelMixin, CustomListM qs = self.filter_queryset(self.get_queryset()) group_by = request.query_params.get("group_by", "") group_by_list = group_by.split(",") - group_by_list.remove("") + if "" in group_by_list: + group_by_list.remove("") if 'mpoint' not in group_by_list: group_by_list.append('mpoint') qs = qs.values() diff --git a/apps/wpm/services.py b/apps/wpm/services.py index 37f1951a..d4a01587 100644 --- a/apps/wpm/services.py +++ b/apps/wpm/services.py @@ -131,7 +131,7 @@ def get_pcoal_heat(year_s: int, month_s: int, day_s: int): else: qs.pcoal_heat = 6000 qs.save(update_fields=['pcoal_heat']) - cache.set(key, qs.pcoal_heat, timeout=60 * 60 * 48) + cache.set(key, qs.pcoal_heat, timeout=60 * 60 * 8) return qs.pcoal_heat except Exception as e: myLogger.error(f'获取煤粉热值失败,{e}', exc_info=True)