(name: str, value: str, _type: str, is_required: bool)
| 600 | |
| 601 | @staticmethod |
| 602 | def convert_value(name: str, value: str, _type: str, is_required: bool): |
| 603 | if not is_required and (value is None or (isinstance(value, str) and len(value.strip()) == 0)): |
| 604 | return None |
| 605 | try: |
| 606 | return common_convert_value(_type, value) |
| 607 | except Exception as e: |
| 608 | raise AppApiException( |
| 609 | 500, |
| 610 | _("Field: {name} Type: {type} Value: {value} Type conversion error").format( |
| 611 | name=name, type=_type, value=value |
| 612 | ), |
| 613 | ) |
| 614 | |
| 615 | class Operate(serializers.Serializer): |
| 616 | id = serializers.UUIDField(required=True, label=_("tool id")) |
no test coverage detected