Project

General

Profile

0001-utils-avoid-crash-on-invalid-import-json-15269.patch

Valentin Deniaud, 19 Dec 2019 04:33 PM

Download (1 KB)

View differences:

Subject: [PATCH 1/3] utils: avoid crash on invalid import json (#15269)

 passerelle/utils/__init__.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
passerelle/utils/__init__.py
338 338

  
339 339
    with transaction.atomic():
340 340
        if import_users:
341
            for apiuser in d['apiusers']:
341
            for apiuser in d.get('apiusers', []):
342 342
                ApiUser.import_json(apiuser, overwrite=overwrite)
343 343

  
344
        for resource in d['resources']:
344
        for resource in d.get('resources', []):
345 345
            BaseResource.import_json(resource, overwrite=overwrite, import_users=import_users)
346 346

  
347 347

  
348
-