def METHOD_NAME(self, data):
    if "duration" in data:
        try:
            time.strptime(data["duration"], "%H:%M:%S")
        except (ValueError, TypeError):
            try:
                data["duration"] = str(timedelta(seconds=data["duration"]))
            except (ValueError, TypeError):
                raise BadRequest(detail="Invalid duration format")
    return super().METHOD_NAME(data)