def METHOD_NAME(projects: QuerySet[IastProject], versionData):
    version_id = versionData.get("version_id", 0)
    project_id = versionData.get("project_id", 0)
    current_version = versionData.get("current_version", 0)
    version_name = versionData.get("version_name", "")
    description = versionData.get("description", "")
    project = projects.filter(id=project_id).only("id", "user").first()
    if not version_name or not project:
        return {"status": "202", "msg": _("Parameter error")}
    baseVersion = IastProjectVersion.objects.filter(
        project_id=project.id,
        version_name=version_name,
        status=1,
    )
    if version_id:
        baseVersion = baseVersion.filter(~Q(id=version_id))
    existVersion = baseVersion.exists()
    if existVersion:
        return {"status": "202", "msg": _("Repeated version name")}
    if version_id:
        version = IastProjectVersion.objects.filter(id=version_id, project_id=project.id, status=1).first()
        if not version:
            return {"status": "202", "msg": _("Version does not exist")}
        version.update_time = int(time.time())
        version.version_name = version_name
        version.description = description
        version.save()
    else:
        version, created = IastProjectVersion.objects.get_or_create(
            project_id=project.id,
            current_version=current_version,
            version_name=version_name,
            description=description,
        )
    version.status = 1
    version.save()
    return {
        "status": "201",
        "msg": "success",
        "data": {
            "version_id": version.id,
            "version_name": version_name,
            "description": description,
        },
    }