Skip to content

Commit 8fb02ed

Browse files
authored
Feature-8829: Additional consent boxes in attendee form (#8933)
* feature-8829: Additional consent boxes in attendee form * feature-8829: Additional consent boxes in attendee form * update revision for downgrade alembic
1 parent a765e36 commit 8fb02ed

File tree

4 files changed

+36
-0
lines changed

4 files changed

+36
-0
lines changed

app/api/schema/attendees.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ def validate_json(self, data, original_data):
7474
complex_field_values = CustomFormValueField(allow_none=True)
7575
is_consent_form_field = fields.Boolean(allow_none=True)
7676
is_consent_of_refund_policy = fields.Boolean()
77+
is_consent_form_field_photo = fields.Boolean(allow_none=True)
78+
is_consent_form_field_email = fields.Boolean(allow_none=True)
7779
language_form_1 = fields.Str(allow_none=True)
7880
language_form_2 = fields.Str(allow_none=True)
7981
event = Relationship(

app/models/custom_form.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@
117117
"language_form_1": {"include": 0, "require": 0},
118118
"language_form_2": {"include": 0, "require": 0},
119119
"is_consent_form_field": {"include": 0, "require": 0},
120+
"is_consent_form_field_photo": {"include": 0, "require": 0},
121+
"is_consent_form_field_email": {"include": 0, "require": 0},
120122
}
121123

122124
ATTENDEE_CUSTOM_FORM = {
@@ -149,6 +151,8 @@
149151
"acceptShareDetails": "Partner contact consent",
150152
"acceptReceiveEmails": "Email consent",
151153
"is_consent_form_field": "Consent form field",
154+
"is_consent_form_field_photo": "Wikimania photo consent",
155+
"is_consent_form_field_email": "Wikimania email updates",
152156
"is_consent_of_refund_policy": "Consent of refund policy",
153157
"language_form_1": "What is your native language, or what language are you most fluent in?",
154158
"language_form_2": "Are you fluent in any other of the following languages?",

app/models/ticket_holder.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ class TicketHolder(SoftDeletionModel):
8080
order = db.relationship('Order', backref='ticket_holders')
8181
ticket = db.relationship('Ticket', backref='ticket_holders')
8282
is_consent_form_field: bool = db.Column(db.Boolean, default=False)
83+
is_consent_form_field_photo: bool = db.Column(db.Boolean, default=False)
84+
is_consent_form_field_email: bool = db.Column(db.Boolean, default=False)
8385

8486
@property
8587
def name(self):
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
"""empty message
2+
3+
Revision ID: 05b1aab46b66
4+
Revises: abf585f1ad76
5+
Create Date: 2023-06-28 15:31:13.401097
6+
7+
"""
8+
9+
import sqlalchemy as sa
10+
from alembic import op
11+
12+
# revision identifiers, used by Alembic.
13+
revision = '05b1aab46b66'
14+
down_revision = 'abf585f1ad76'
15+
16+
17+
def upgrade():
18+
# ### commands auto generated by Alembic - please adjust! ###
19+
op.add_column('ticket_holders', sa.Column('is_consent_form_field_photo', sa.Boolean(), nullable=True))
20+
op.add_column('ticket_holders', sa.Column('is_consent_form_field_email', sa.Boolean(), nullable=True))
21+
# ### end Alembic commands ###
22+
23+
24+
def downgrade():
25+
# ### commands auto generated by Alembic - please adjust! ###
26+
op.drop_column('ticket_holders', 'is_consent_form_field_email')
27+
op.drop_column('ticket_holders', 'is_consent_form_field_photo')
28+
# ### end Alembic commands ###

0 commit comments

Comments
 (0)