From be99eb82e89ae29f7e315d92652970d9d1b47f6c Mon Sep 17 00:00:00 2001 From: ibuler Date: Wed, 23 Nov 2016 19:37:47 +0800 Subject: [PATCH] udpate some bug --- apps/users/templates/users/_user_import_modal.html | 6 ++---- apps/users/templates/users/user_list.html | 4 ++-- apps/users/views.py | 3 +++ 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/apps/users/templates/users/_user_import_modal.html b/apps/users/templates/users/_user_import_modal.html index 99a61d126..0993d26fe 100644 --- a/apps/users/templates/users/_user_import_modal.html +++ b/apps/users/templates/users/_user_import_modal.html @@ -3,13 +3,11 @@ {% block modal_id %}user_import_modal{% endblock %} {% block modal_title%}{% trans "Import User" %}{% endblock %} {% block modal_body %} -

{% trans "Hint: your excel should organized in the following format." %}

-

{% trans "* You should have a very worksheet named `users`." %}

-

{% trans "* Rows in this worksheet: username, email, enable_opt(0, 1), role(one of ['Admin', 'User'])" %}

+

{% trans " * CSV format should be same as export" %}

{% csrf_token %}
- +
diff --git a/apps/users/templates/users/user_list.html b/apps/users/templates/users/user_list.html index d8ba6c7af..87fd018cc 100644 --- a/apps/users/templates/users/user_list.html +++ b/apps/users/templates/users/user_list.html @@ -3,8 +3,8 @@ {% block table_search %}
- - PDF +{# #} +{# PDF#} CSV diff --git a/apps/users/views.py b/apps/users/views.py index 2f206fc8b..6bc35f8f6 100644 --- a/apps/users/views.py +++ b/apps/users/views.py @@ -3,7 +3,9 @@ from __future__ import unicode_literals import json import uuid +from io import BytesIO +from reportlab.pdfgen import canvas import unicodecsv as csv from django import forms from django.utils import timezone @@ -570,3 +572,4 @@ class ExportUserCsvView(View): cache.set(spm, users_id, 300) url = reverse('users:export-user-csv') + '?spm=%s' % spm return JsonResponse({'redirect': url}) +