Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Addition of is_promoted field in event #6755

Merged
merged 3 commits into from
Jan 19, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/api/schema/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def validate_timezone(self, data, original_data):
code_of_conduct = fields.Str(allow_none=True)
schedule_published_on = fields.DateTime(allow_none=True)
is_featured = fields.Bool(default=False)
is_promoted = fields.Bool(default=False)
is_ticket_form_enabled = fields.Bool(default=True)
payment_country = fields.Str(allow_none=True)
payment_currency = fields.Str(allow_none=True)
Expand Down
3 changes: 3 additions & 0 deletions app/models/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class Event(SoftDeletionModel):
location_name = db.Column(db.String)
searchable_location_name = db.Column(db.String)
is_featured = db.Column(db.Boolean, default=False, nullable=False)
is_promoted = db.Column(db.Boolean, default=False, nullable=False)
description = db.Column(db.Text)
original_image_url = db.Column(db.String)
thumbnail_image_url = db.Column(db.String)
Expand Down Expand Up @@ -224,6 +225,7 @@ def __init__(self,
identifier=None,
can_pay_by_bank=False,
is_featured=False,
is_promoted=False,
can_pay_onsite=False,
cheque_details=None,
bank_details=None,
Expand Down Expand Up @@ -289,6 +291,7 @@ def __init__(self,
self.can_pay_by_paytm = can_pay_by_paytm
self.is_donation_enabled = is_donation_enabled
self.is_featured = is_featured
self.is_promoted = is_promoted
self.is_ticket_form_enabled = is_ticket_form_enabled
self.identifier = get_new_event_identifier()
self.cheque_details = cheque_details
Expand Down
30 changes: 30 additions & 0 deletions migrations/versions/rev-2020-01-18-17:42:13-085a8e2fdfed_.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""empty message

Revision ID: 085a8e2fdfed
Revises: 6ebafb385765
Create Date: 2020-01-18 17:42:13.143533

"""

from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils


# revision identifiers, used by Alembic.
revision = '085a8e2fdfed'
down_revision = '6ebafb385765'


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('events', sa.Column('is_promoted', sa.Boolean(), server_default='False', nullable=False))
op.add_column('events_version', sa.Column('is_promoted', sa.Boolean(), autoincrement=False, server_default='False', nullable=True))
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('events_version', 'is_promoted')
op.drop_column('events', 'is_promoted')
# ### end Alembic commands ###