(value)
| 18 | |
| 19 | |
| 20 | def _parse_environment_ids(value): |
| 21 | if value in (None, "", []): |
| 22 | return [] |
| 23 | if isinstance(value, list): |
| 24 | parsed = value |
| 25 | else: |
| 26 | try: |
| 27 | parsed = json.loads(value) |
| 28 | except (TypeError, json.JSONDecodeError): |
| 29 | return None |
| 30 | if parsed is None: |
| 31 | return [] |
| 32 | if not isinstance(parsed, list): |
| 33 | return None |
| 34 | environment_ids = [] |
| 35 | for item in parsed: |
| 36 | if item in (None, ""): |
| 37 | continue |
| 38 | if not isinstance(item, str): |
| 39 | return None |
| 40 | environment_ids.append(item) |
| 41 | return list(dict.fromkeys(environment_ids)) |
| 42 | |
| 43 | |
| 44 | class StorageCreateForm(StarletteForm): |
no outgoing calls
no test coverage detected