From a2cf6e8fa698534be4cea9dfed62a67825e7bad8 Mon Sep 17 00:00:00 2001 From: Victoria Earl Date: Thu, 12 Oct 2023 18:49:35 -0400 Subject: [PATCH] Remove setup/teardown approval options We're making all setup and teardown shifts available by default without needing approval. Also updates the "creating shifts" step to explain roles a bit better, and updates the department head checklist page to correctly display checkboxes. --- uber/models/department.py | 13 +++++++++-- uber/templates/dept_admin/form.html | 25 ---------------------- uber/templates/dept_admin/index.html | 4 ---- uber/templates/dept_admin/new.html | 18 ---------------- uber/templates/dept_checklist/index.html | 2 +- uber/templates/forms/attendee.html | 7 ------ uber/templates/shifts_admin/index.html | 8 ++++--- uber/templates/shifts_admin/main_menu.html | 4 ++-- uber/templates/staffing/hotel_item.html | 1 + 9 files changed, 20 insertions(+), 62 deletions(-) diff --git a/uber/models/department.py b/uber/models/department.py index ea400fe38..a138cdb51 100644 --- a/uber/models/department.py +++ b/uber/models/department.py @@ -11,6 +11,7 @@ from sqlalchemy.types import Boolean, Float, Integer from uber.config import c +from uber.decorators import presave_adjustment from uber.models import MagModel from uber.models.attendee import Attendee from uber.models.types import default_relationship as relationship, Choice, DefaultColumn as Column @@ -159,8 +160,8 @@ class Department(MagModel): solicits_volunteers = Column(Boolean, default=True) is_shiftless = Column(Boolean, default=False) parent_id = Column(UUID, ForeignKey('department.id'), nullable=True) - is_setup_approval_exempt = Column(Boolean, default=False) - is_teardown_approval_exempt = Column(Boolean, default=False) + is_setup_approval_exempt = Column(Boolean, default=True) + is_teardown_approval_exempt = Column(Boolean, default=True) max_consecutive_minutes = Column(Integer, default=0) jobs = relationship('Job', backref='department') @@ -272,6 +273,14 @@ class Department(MagModel): cascade='save-update,merge,refresh-expire,expunge', remote_side='Department.id', single_parent=True) + + @presave_adjustment + def force_approval_exempt(self): + # We used to have a system where departments would approve staffers for + # setup and teardown shifts -- we're getting rid of this option, which + # is most easily accomplished by making all departments always exempt + self.is_setup_approval_exempt = True + self.is_teardown_approval_exempt = True @hybrid_property def member_count(self): diff --git a/uber/templates/dept_admin/form.html b/uber/templates/dept_admin/form.html index f91536228..e069908da 100644 --- a/uber/templates/dept_admin/form.html +++ b/uber/templates/dept_admin/form.html @@ -218,24 +218,6 @@