Project

General

Profile

0001-cartads_cs-add-method-to-override-PDF-URLs-35974.patch

Frédéric Péters, 09 Sep 2019 05:24 PM

Download (1.39 KB)

View differences:

Subject: [PATCH] cartads_cs: add method to override PDF URLs (#35974)

 passerelle/apps/cartads_cs/models.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
passerelle/apps/cartads_cs/models.py
161 161
        'description': _('Token for upload file'),
162 162
    }
163 163

  
164
    def fix_pdf_url(self, url):
165
        # method subclasses can override if the URL returned for PDF documents
166
        # by Cart@DS do not match reverse proxies, API managers, and stuff.
167
        return url
168

  
164 169
    def update_data_cache(self):
165 170
        client = self.soap_client()
166 171

  
......
224 229
                data_cache.data_values = {'data': [
225 230
                    {'id': x['Identifiant'],
226 231
                     'text': format_cerfa_label(x),
227
                     'url': x['UrlTelechargement'],
232
                     'url': self.fix_pdf_url(x['UrlTelechargement']),
228 233
                    } for x in resp or []]}
229 234

  
230 235
                for value in data_cache.data_values['data']:
231
-