Projet

Général

Profil

0001-mdel-ignore-case-when-searching-for-response-files-2.patch

Josué Kouka, 18 juillet 2018 09:53

Télécharger (2 ko)

Voir les différences:

Subject: [PATCH] mdel: ignore case when searching for response files (#24912)

 passerelle/contrib/mdel/models.py                   |   8 ++++++--
 .../{102-2-AEC-LA--1.zip => 102-2-aec-la--1.zip}    | Bin
 .../{102-2-AEC-LA--4.zip => 102-2-aec-la--4.zip}    | Bin
 3 files changed, 6 insertions(+), 2 deletions(-)
 rename tests/data/mdel/test/outputs/{102-2-AEC-LA--1.zip => 102-2-aec-la--1.zip} (100%)
 rename tests/data/mdel/test/outputs/{102-2-AEC-LA--4.zip => 102-2-aec-la--4.zip} (100%)
passerelle/contrib/mdel/models.py
320 320
        output_dir = os.path.join(resource_base_dir, self.resource.slug,
321 321
                                  'outputs')
322 322

  
323
        zfiles = [zfile for zfile in os.listdir(output_dir)
324
                  if zfile.startswith(self.demand_id) and zfile.endswith('.zip')]
323
        # search demand response zip file
324
        # without caring about the case
325
        zfiles = []
326
        for zfile in os.listdir(output_dir):
327
            if zfile.lower().startswith(self.demand_id.lower()) and zfile.lower().endswith('.zip'):
328
                zfiles.append(zfile)
325 329

  
326 330
        def fnum(zfile):
327 331
            """Returns response's file number