housekeep: TU rename - code changes

Renaming of symbols. Functions, variables, values, DB values, etc.
Basically everything that is not user-facing.

This only covers "Trusted User" things:
tests, comments, etc. will covered in a following commit.
This commit is contained in:
moson 2023-09-01 13:25:21 +02:00
parent 7466e96449
commit 1702075875
No known key found for this signature in database
GPG key ID: 4A4760AB4EE15296
34 changed files with 265 additions and 203 deletions

View file

@ -0,0 +1,37 @@
"""Rename TU to Package Maintainer
Revision ID: 6a64dd126029
Revises: c5a6a9b661a0
Create Date: 2023-09-01 13:48:15.315244
"""
from aurweb import db
from aurweb.models import AccountType
# revision identifiers, used by Alembic.
revision = "6a64dd126029"
down_revision = "c5a6a9b661a0"
branch_labels = None
depends_on = None
# AccountTypes
# ID 2 -> Trusted User / Package Maintainer
# ID 4 -> Trusted User & Developer / Package Maintainer & Developer
def upgrade():
with db.begin():
tu = db.query(AccountType).filter(AccountType.ID == 2).first()
tudev = db.query(AccountType).filter(AccountType.ID == 4).first()
tu.AccountType = "Package Maintainer"
tudev.AccountType = "Package Maintainer & Developer"
def downgrade():
with db.begin():
pm = db.query(AccountType).filter(AccountType.ID == 2).first()
pmdev = db.query(AccountType).filter(AccountType.ID == 4).first()
pm.AccountType = "Trusted User"
pmdev.AccountType = "Trusted User & Developer"