Explorar o código

修改下载文件名

tanghongbin %!s(int64=4) %!d(string=hai) anos
pai
achega
bcb9333804
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      Controller/AdminManage.py

+ 1 - 1
Controller/AdminManage.py

@@ -446,7 +446,7 @@ class AdminManage(TemplateView):
         user_qs = Device_User.objects.filter(subscribe_email=1).values('userEmail')
         print(user_qs)
         response = HttpResponse(content_type='application/vnd.ms-excel')
-        response['Content-Disposition'] = 'attachment; filename=UID' + time.strftime('-%Y-%m-%d-%H-%M-%S', time.localtime()) + '.xls'
+        response['Content-Disposition'] = 'attachment; filename=Email' + time.strftime('-%Y-%m-%d-%H-%M-%S', time.localtime()) + '.xls'
         workbook = xlwt.Workbook(encoding='utf-8')
         sheet1 = workbook.add_sheet('Email Address')