Projet

Général

Profil

0024-misc-fix-consider-using-in-pylint-error-62099.patch

Lauréline Guérin, 22 mars 2022 10:30

Télécharger (3,19 ko)

Voir les différences:

Subject: [PATCH 24/65] misc: fix consider-using-in pylint error (#62099)

 passerelle/apps/csvdatasource/models.py    | 2 +-
 passerelle/apps/gdc/views.py               | 2 +-
 passerelle/contrib/toulouse_axel/models.py | 7 +------
 passerelle/utils/xml.py                    | 2 +-
 4 files changed, 4 insertions(+), 9 deletions(-)
passerelle/apps/csvdatasource/models.py
261 261
            if file_type == 'ods':
262 262
                content = get_data_ods(self.csv_file)
263 263

  
264
            elif file_type == 'xls' or file_type == 'xlsx':
264
            elif file_type in ('xls', 'xlsx'):
265 265
                # Suffix is necessary as pyexcel is too stupid to detect the
266 266
                # filetype from content
267 267
                with tempfile.NamedTemporaryFile(mode='wb', suffix='.' + file_type) as fd:
passerelle/apps/gdc/views.py
146 146
                return utils.response_for_json(request, result)
147 147
            normalized_voie = normalize(voie_str).upper()
148 148
            for k, v in voies:
149
                if v == normalized_voie or k == normalized_voie:
149
                if normalized_voie in (v, k):
150 150
                    voie_id = k
151 151
                    break
152 152

  
passerelle/contrib/toulouse_axel/models.py
939 939
            # exclude also child with more than one registration per activity_type or missing activity
940 940
            activity_types = [a['TYPEACTIVITE'] for a in child.get('ACTIVITE', [])]
941 941
            activity_types.sort()
942
            if activity_types != ['MAT', 'MIDI', 'SOIR'] and activity_types != [
943
                'GARD',
944
                'MAT',
945
                'MIDI',
946
                'SOIR',
947
            ]:
942
            if activity_types not in (['MAT', 'MIDI', 'SOIR'], ['GARD', 'MAT', 'MIDI', 'SOIR']):
948 943
                # GARD is optional
949 944
                continue
950 945
            # ok, store child
passerelle/utils/xml.py
255 255

  
256 256
        if group.model == 'choice':
257 257
            cls.choice_to_alternatives(group, alternatives=alternatives)
258
        elif group.model == 'sequence' or group.model == 'all':
258
        elif group.model in ('sequence', 'all'):
259 259
            cls.sequence_to_alternatives(group, alternatives=alternatives)
260 260
        else:
261 261
            raise NotImplementedError(group)
262
-