mirror of
https://github.com/WeblateOrg/weblate.git
synced 2026-07-27 22:09:03 +08:00
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
19 lines
703 B
Python
Vendored
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)
|