Skip to content

Commit

Permalink
Merge pull request #4385 from MidwestFurryFandom/prereg-2024
Browse files Browse the repository at this point in the history
Merge updates from AnthroCon and MFF
  • Loading branch information
kitsuta committed Aug 1, 2024
2 parents 133cb17 + f06ca28 commit ec4d133
Show file tree
Hide file tree
Showing 136 changed files with 4,830 additions and 1,655 deletions.
5 changes: 3 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
# See the developers guide for full instructions on how to configure and use extra plugins!

PLUGIN_NAME=yourplugin
PLUGIN_DIR_SRC=$PWD/../${PLUGIN_NAME}/
PLUGIN_DIR_SRC=../${PLUGIN_NAME}/
PLUGIN_DIR_TARGET=/app/plugins/${PLUGIN_NAME}
COMPOSE_PROFILES=dev

## SINGLE-EVENT SETUP
# Change YOURPLUGIN to your plugin name in all-caps (e.g., MAGPRIME)
#
UBER_CONFIG_FILES=uber.ini
uber_plugins=["${PLUGIN_NAME}"]
YOURPLUGIN_CONFIG_FILES=${PLUGIN_NAME}
YOURPLUGIN_CONFIG_FILES=${PLUGIN_NAME}.ini

## MULTI-EVENT SETUP
# You probably don't need this!
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/ci-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@ jobs:
steps:
- id: set-matrix
run: |
echo "matrix={\"include\":$(echo "${{ vars.DOCKER_BUILDS }}" | yq -o=json -I 0 e '.branches.${{ github.ref_name }} // [{"name":"magfest/ubersystem:${{ github.ref_name }}", "plugins":[]}]' -)}" >> $GITHUB_OUTPUT
echo "matrix={\"include\":$(echo "${{ vars.DOCKER_BUILDS }}" | yq -o=json -I 0 e '.branches.${{ github.ref_name }} // [{"name":"anthrocon-rams/rams:${{ github.ref_name }}", "plugins":[]}]' -)}" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
build_downstream:
permissions:
contents: read
packages: write
needs: downstream
strategy:
matrix: ${{ fromJson(needs.downstream.outputs.matrix) }}
Expand Down Expand Up @@ -49,6 +52,9 @@ jobs:
tags: ghcr.io/${{ matrix.name }}

build:
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
steps:
- name: Checkout Code
Expand Down Expand Up @@ -80,4 +86,4 @@ jobs:
build-args: BRANCH=${{ github.ref_name }}
context: "."
push: true
tags: ghcr.io/${{ github.repository }}:${{ github.ref_name }}
tags: ghcr.io/anthrocon-rams/rams:${{ github.ref_name }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,6 @@ uber/static/fonts/free3of9.pkl
config*.ini
uber.ini
.env
.venv/
.venv/
ssl-cert.pem
ssl-key.pem
17 changes: 17 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
include:
- template: 'Workflows/Branch-Pipelines.gitlab-ci.yml'

stages:
- build

build:
image: docker:26.1.4
stage: build
services:
- docker:26.1.4-dind
variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build -t $IMAGE_TAG .
- docker push $IMAGE_TAG
12 changes: 6 additions & 6 deletions .pythonstartup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
Attendee.email == '[email protected]'
).order_by(AdminAccount.id).first()

if admin:
# Make it easier to do site section testing at the command line
cherrypy.session = {'account_id': admin.id}
print('Logged in as {} <{}>'.format(admin.attendee.full_name, admin.attendee.email))
elif c.DEV_BOX:
print('INFO: Could not find Test Developer admin account')
if admin:
# Make it easier to do site section testing at the command line
cherrypy.session = {'account_id': admin.id}
print('Logged in as {} <{}>'.format(admin.attendee.full_name, admin.attendee.email))
else:
print('INFO: Could not find Test Developer admin account')

except Exception as ex:
print('ERROR: Could not initialize ubersystem environment')
Expand Down
63 changes: 63 additions & 0 deletions alembic/versions/37f79e6ccee7_artist_payout_method_field.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
"""Artist payout method field
Revision ID: 37f79e6ccee7
Revises: 93514f9f4520
Create Date: 2024-06-06 12:18:23.844115
"""


# revision identifiers, used by Alembic.
revision = '37f79e6ccee7'
down_revision = '93514f9f4520'
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa



try:
is_sqlite = op.get_context().dialect.name == 'sqlite'
except Exception:
is_sqlite = False

if is_sqlite:
op.get_context().connection.execute('PRAGMA foreign_keys=ON;')
utcnow_server_default = "(datetime('now', 'utc'))"
else:
utcnow_server_default = "timezone('utc', current_timestamp)"

def sqlite_column_reflect_listener(inspector, table, column_info):
"""Adds parenthesis around SQLite datetime defaults for utcnow."""
if column_info['default'] == "datetime('now', 'utc')":
column_info['default'] = utcnow_server_default

sqlite_reflect_kwargs = {
'listeners': [('column_reflect', sqlite_column_reflect_listener)]
}

# ===========================================================================
# HOWTO: Handle alter statements in SQLite
#
# def upgrade():
# if is_sqlite:
# with op.batch_alter_table('table_name', reflect_kwargs=sqlite_reflect_kwargs) as batch_op:
# batch_op.alter_column('column_name', type_=sa.Unicode(), server_default='', nullable=False)
# else:
# op.alter_column('table_name', 'column_name', type_=sa.Unicode(), server_default='', nullable=False)
#
# ===========================================================================


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('art_show_application', sa.Column('payout_method', sa.Integer(), server_default='25184922', nullable=False))
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('art_show_application', 'payout_method')
# ### end Alembic commands ###
59 changes: 59 additions & 0 deletions alembic/versions/3fe61d6e4837_add_admin_notes_for_promo_codes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
"""Add admin notes for promo codes
Revision ID: 3fe61d6e4837
Revises: 459045b27a25
Create Date: 2024-07-10 01:38:14.558297
"""


# revision identifiers, used by Alembic.
revision = '3fe61d6e4837'
down_revision = '459045b27a25'
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa



try:
is_sqlite = op.get_context().dialect.name == 'sqlite'
except Exception:
is_sqlite = False

if is_sqlite:
op.get_context().connection.execute('PRAGMA foreign_keys=ON;')
utcnow_server_default = "(datetime('now', 'utc'))"
else:
utcnow_server_default = "timezone('utc', current_timestamp)"

def sqlite_column_reflect_listener(inspector, table, column_info):
"""Adds parenthesis around SQLite datetime defaults for utcnow."""
if column_info['default'] == "datetime('now', 'utc')":
column_info['default'] = utcnow_server_default

sqlite_reflect_kwargs = {
'listeners': [('column_reflect', sqlite_column_reflect_listener)]
}

# ===========================================================================
# HOWTO: Handle alter statements in SQLite
#
# def upgrade():
# if is_sqlite:
# with op.batch_alter_table('table_name', reflect_kwargs=sqlite_reflect_kwargs) as batch_op:
# batch_op.alter_column('column_name', type_=sa.Unicode(), server_default='', nullable=False)
# else:
# op.alter_column('table_name', 'column_name', type_=sa.Unicode(), server_default='', nullable=False)
#
# ===========================================================================


def upgrade():
op.add_column('promo_code', sa.Column('admin_notes', sa.Unicode(), server_default='', nullable=False))


def downgrade():
op.drop_column('promo_code', 'admin_notes')
61 changes: 61 additions & 0 deletions alembic/versions/459045b27a25_add_replyto_for_emails.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
"""Add replyto for emails
Revision ID: 459045b27a25
Revises: b4d9068d50c3
Create Date: 2024-06-30 01:37:29.917475
"""


# revision identifiers, used by Alembic.
revision = '459045b27a25'
down_revision = 'b4d9068d50c3'
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa



try:
is_sqlite = op.get_context().dialect.name == 'sqlite'
except Exception:
is_sqlite = False

if is_sqlite:
op.get_context().connection.execute('PRAGMA foreign_keys=ON;')
utcnow_server_default = "(datetime('now', 'utc'))"
else:
utcnow_server_default = "timezone('utc', current_timestamp)"

def sqlite_column_reflect_listener(inspector, table, column_info):
"""Adds parenthesis around SQLite datetime defaults for utcnow."""
if column_info['default'] == "datetime('now', 'utc')":
column_info['default'] = utcnow_server_default

sqlite_reflect_kwargs = {
'listeners': [('column_reflect', sqlite_column_reflect_listener)]
}

# ===========================================================================
# HOWTO: Handle alter statements in SQLite
#
# def upgrade():
# if is_sqlite:
# with op.batch_alter_table('table_name', reflect_kwargs=sqlite_reflect_kwargs) as batch_op:
# batch_op.alter_column('column_name', type_=sa.Unicode(), server_default='', nullable=False)
# else:
# op.alter_column('table_name', 'column_name', type_=sa.Unicode(), server_default='', nullable=False)
#
# ===========================================================================


def upgrade():
op.add_column('automated_email', sa.Column('replyto', sa.Unicode(), server_default='', nullable=False))
op.add_column('email', sa.Column('replyto', sa.Unicode(), server_default='', nullable=False))


def downgrade():
op.drop_column('email', 'replyto')
op.drop_column('automated_email', 'replyto')
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
"""Separate promo code and art show agent codes.
Revision ID: 56d684473beb
Revises: 7c43e4352bb0
Create Date: 2024-05-31 03:19:53.022061
"""


# revision identifiers, used by Alembic.
revision = '56d684473beb'
down_revision = '7c43e4352bb0'
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
import residue


try:
is_sqlite = op.get_context().dialect.name == 'sqlite'
except Exception:
is_sqlite = False

if is_sqlite:
op.get_context().connection.execute('PRAGMA foreign_keys=ON;')
utcnow_server_default = "(datetime('now', 'utc'))"
else:
utcnow_server_default = "timezone('utc', current_timestamp)"

def sqlite_column_reflect_listener(inspector, table, column_info):
"""Adds parenthesis around SQLite datetime defaults for utcnow."""
if column_info['default'] == "datetime('now', 'utc')":
column_info['default'] = utcnow_server_default

sqlite_reflect_kwargs = {
'listeners': [('column_reflect', sqlite_column_reflect_listener)]
}

# ===========================================================================
# HOWTO: Handle alter statements in SQLite
#
# def upgrade():
# if is_sqlite:
# with op.batch_alter_table('table_name', reflect_kwargs=sqlite_reflect_kwargs) as batch_op:
# batch_op.alter_column('column_name', type_=sa.Unicode(), server_default='', nullable=False)
# else:
# op.alter_column('table_name', 'column_name', type_=sa.Unicode(), server_default='', nullable=False)
#
# ===========================================================================


def upgrade():
op.create_table('art_show_agent_code',
sa.Column('id', residue.UUID(), nullable=False),
sa.Column('app_id', residue.UUID(), nullable=False),
sa.Column('attendee_id', residue.UUID(), nullable=True),
sa.Column('code', sa.Unicode(), server_default='', nullable=False),
sa.Column('cancelled', residue.UTCDateTime(), nullable=True),
sa.ForeignKeyConstraint(['app_id'], ['art_show_application.id'], name=op.f('fk_art_show_agent_code_app_id_art_show_application')),
sa.ForeignKeyConstraint(['attendee_id'], ['attendee.id'], name=op.f('fk_art_show_agent_code_attendee_id_attendee'), ondelete='SET NULL'),
sa.PrimaryKeyConstraint('id', name=op.f('pk_art_show_agent_code')),
sa.UniqueConstraint('attendee_id', name=op.f('uq_art_show_agent_code_attendee_id'))
)
op.drop_constraint('fk_art_show_application_agent_id_attendee', 'art_show_application', type_='foreignkey')
op.drop_column('art_show_application', 'agent_code')
op.drop_column('art_show_application', 'agent_id')


def downgrade():
op.add_column('art_show_application', sa.Column('agent_id', postgresql.UUID(), autoincrement=False, nullable=True))
op.add_column('art_show_application', sa.Column('agent_code', sa.VARCHAR(), server_default=sa.text("''::character varying"), autoincrement=False, nullable=False))
op.create_foreign_key('fk_art_show_application_agent_id_attendee', 'art_show_application', 'attendee', ['agent_id'], ['id'], ondelete='SET NULL')
op.drop_table('art_show_agent_code')
Loading

0 comments on commit ec4d133

Please sign in to comment.