diff --git a/src/customer/views/profile.py b/src/customer/views/profile.py index c1f580c..e9916ea 100644 --- a/src/customer/views/profile.py +++ b/src/customer/views/profile.py @@ -4,7 +4,7 @@ import json import tempfile from email.header import Header -from django.shortcuts import render, redirect, get_object_or_404 +from django.shortcuts import render, redirect from django.core.files import File from django.views.decorators.csrf import csrf_protect from django.contrib.auth.decorators import login_required @@ -14,13 +14,11 @@ from django.utils.encoding import smart_str from django.conf import settings from django.http import Http404, HttpResponse -# from sorl.thumbnail import get_thumbnail from easy_thumbnails.files import get_thumbnailer from commons.pdf_tools import render_pdf_to_string, pdf_to_response from customer import models, forms -from customer.decorators import license_required from customer.utils import raise_if_no_profile PDF_PROFILE_NAME = u'Реквизиты.pdf' diff --git a/src/docs/views/base_views.py b/src/docs/views/base_views.py index 5113c2d..d5a6994 100644 --- a/src/docs/views/base_views.py +++ b/src/docs/views/base_views.py @@ -185,7 +185,8 @@ class BaseViews(object): def get_filename(self, *args, **kwargs): obj = self.get_obj(kwargs['id']) - client = obj.client.name.replace('\n', ' ').replace('\r', ' ').strip() + client = obj.client.name_short_dadata.replace('\n', ' ').replace('\r', ' ').strip() + return self.FILENAME % (obj.doc_num, client,) def update_list_dict(self, dictionary):