weblate/ci/migrate-scripts/setup-workspaces.py
Michal Čihař e4d4e7ad00 feat(workspaces): initial workspaces implementation
Add workspaces as a top-level containers above projects and migrate
billing to it. This does not add any new functionality just introduces
the model and migrates billing to it.

Issue #19535
2026-05-26 08:13:37 +02:00

19 lines
703 B
Python
Vendored

# Copyright © Michal Čihař <michal@weblate.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Set up billing projects for workspace migration testing."""
from weblate.billing.models import Billing, Plan
from weblate.trans.models import Project
plan_kwargs = {"name": "Workspace migration plan", "price": 29, "yearly_price": 299}
if hasattr(Plan, "slug"):
plan_kwargs["slug"] = "workspace-migration"
plan = Plan.objects.create(**plan_kwargs)
billing = Billing.objects.create(plan=plan)
project = Project.objects.create(name="Workspace Migration", slug="workspace-migration")
# This script runs before migration, against the older checked-out Weblate version.
billing.projects.add(project)