Skip to content

Commit

Permalink
Add wants_visualist to band checklist
Browse files Browse the repository at this point in the history
Also updates the date for the shifts_worked email.
  • Loading branch information
kitsuta committed Jun 13, 2024
1 parent 5bcdff6 commit c6c6568
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
"""Add wants_visualist to band checklist
Revision ID: 60318045a6fe
Revises: 3b31528fe2cb
Create Date: 2024-06-13 16:15:17.089746
"""


# revision identifiers, used by Alembic.
revision = '60318045a6fe'
down_revision = '3b31528fe2cb'
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('guest_stage_plot', sa.Column('wants_visualist', sa.Boolean(), server_default='False', nullable=False))


def downgrade():
op.drop_column('guest_stage_plot', 'wants_visualist')
12 changes: 6 additions & 6 deletions magwest/models.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
from uber.models import Session
from uber.models import Session, Boolean
from uber.models.types import DefaultColumn as Column, MultiChoice
from uber.config import c


@Session.model_mixin
class Attendee:
@property
def num_free_event_shirts(self):
return 1 if self.badge_type == c.STAFF_BADGE else self.volunteer_event_shirt_eligible

@property
def approved_panel_apps(self):
return [panel.name for panel in self.panel_applications if panel.status == c.ACCEPTED]


@Session.model_mixin
class GuestMerch:
extra_merch_time = Column(MultiChoice(c.EXTRA_MERCH_TIME_OPTS))
extra_merch_time = Column(MultiChoice(c.EXTRA_MERCH_TIME_OPTS))

@Session.model_mixin
class GuestStagePlot:
wants_visualist = Column(Boolean, default=False)
2 changes: 1 addition & 1 deletion magwest/templates/emails/shifts/shifts_worked.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

{% if c.HOTELS_ENABLED %}<br/><br/>Remember, if you don't have at least {{ c.HOURS_FOR_REFUND }} weighted hours, you won't be eligible for a staff badge or hotel space for {{ c.EVENT_NAME }} {{ c.EPOCH|datetime_local("%Y")|int + 1 }}. If you don't have {{ c.HOURS_FOR_HOTEL_SPACE }} weighted hours and claimed hotel space this year, we will also be reviewing your eligibility for next event.{% endif %}

<br/><br/>If you have any issues with the shifts listed, please contact us before August 15 so that we can fix any issues that could impact your ability to staff{% if c.HOTELS_ENABLED %} or request hotel space{% endif %} next year.
<br/><br/>If you have any issues with the shifts listed, please contact us before October 31 so that we can fix any issues that could impact your ability to staff{% if c.HOTELS_ENABLED %} or request hotel space{% endif %} next year.

<br/>
<table width="95%" align="center">
Expand Down
11 changes: 11 additions & 0 deletions magwest/templates/guest_checklist/stage_plot_deadline.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,14 @@
<br/></br>
Failure to provide exact stage directions may result in you not receiving the setup you expect or want.
{% endblock %}

{% block form_extra %}
<div class="form-group">
<div class="checkbox col-sm-6 col-sm-offset-3">
<label class="checkbox-label">
{{ macros.checkbox(guest_stage_plot, 'wants_visualist') }}
We would like MAGWest to supply a visualist for our performance.
</label>
</div>
</div>
{% endblock %}

0 comments on commit c6c6568

Please sign in to comment.