Skip to content

Commit

Permalink
Replace allow_rsvp in form with rsvp_state
Browse files Browse the repository at this point in the history
  • Loading branch information
jace committed Nov 20, 2023
1 parent 14ac06a commit 7f3a2d6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions funnel/forms/sync_ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from baseframe import __, forms

from ..models import (
RSVP_STATE,
Account,
AccountEmail,
Project,
Expand Down Expand Up @@ -68,9 +69,8 @@ class ProjectBoxofficeForm(forms.Form):
validators=[forms.validators.AllowedIf('org')],
filters=[forms.filters.strip()],
)
allow_rsvp = forms.BooleanField(
__("Allow free registrations"),
default=False,
rsvp_state = forms.RadioField(
__("Registrations"), choices=RSVP_STATE.items(), default=RSVP_STATE.NONE
)
is_subscription = forms.BooleanField(
__("Paid tickets are for a subscription"),
Expand Down
2 changes: 1 addition & 1 deletion funnel/models/membership_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ def replace(
return new

@with_roles(call={'editor'})
def amend_by(self: MembershipType, actor: Account):
def amend_by(self, actor: Account):
"""Amend a membership in a `with` context."""
return AmendMembership(self, actor)

Expand Down
2 changes: 1 addition & 1 deletion funnel/models/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
visual_field_delimiter,
)

__all__ = ['Project', 'ProjectLocation', 'ProjectRedirect']
__all__ = ['RSVP_STATE', 'Project', 'ProjectLocation', 'ProjectRedirect']


# --- Constants ---------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions funnel/views/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ def edit_boxoffice_data(self) -> ReturnView:
obj=SimpleNamespace(
org=boxoffice_data.get('org', ''),
item_collection_id=boxoffice_data.get('item_collection_id', ''),
allow_rsvp=self.obj.allow_rsvp,
rsvp_state=self.obj.rsvp_state,
is_subscription=boxoffice_data.get('is_subscription', True),
register_form_schema=boxoffice_data.get('register_form_schema'),
register_button_txt=boxoffice_data.get('register_button_txt', ''),
Expand All @@ -598,7 +598,7 @@ def edit_boxoffice_data(self) -> ReturnView:
model=Project,
)
if form.validate_on_submit():
form.populate_obj(self.obj)
self.obj.rsvp_state = form.rsvp_state.data
self.obj.boxoffice_data['org'] = form.org.data
self.obj.boxoffice_data['item_collection_id'] = form.item_collection_id.data
self.obj.boxoffice_data['is_subscription'] = form.is_subscription.data
Expand Down

0 comments on commit 7f3a2d6

Please sign in to comment.