shop logo_banner boolean field to fixup UX
modified: make_post_sell/models/shop.py new file: make_post_sell/scripts/alembic/versions/aad3d454a6f4_shop_logo_banner_boolean.py modified: make_post_sell/views/shop.py
This commit is contained in:
parent
0e9f1e9b2b
commit
6dfd50c3fa
3 changed files with 34 additions and 0 deletions
|
|
@ -69,6 +69,7 @@ class Shop(RBase, Base):
|
|||
|
||||
maint_mode = Column(Boolean, default=False)
|
||||
favicon = Column(Boolean, default=False)
|
||||
logo_banner = Column(Boolean, default=False)
|
||||
|
||||
# many to many uses association_proxy.
|
||||
users = association_proxy("shop_users", "user", creator=lambda u: UserShop(user=u))
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
"""shop logo_banner boolean
|
||||
|
||||
Revision ID: aad3d454a6f4
|
||||
Revises: 03292288a132
|
||||
Create Date: 2022-06-30 16:48:22.471896
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'aad3d454a6f4'
|
||||
down_revision = '03292288a132'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
from make_post_sell.models.meta import UUIDType
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('mps_shop', sa.Column('logo_banner', sa.Boolean(), nullable=True, server_default="1"))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('mps_shop', 'logo_banner')
|
||||
# ### end Alembic commands ###
|
||||
|
|
@ -499,6 +499,9 @@ def shop_settings(request):
|
|||
if file_key == "shop-favicon":
|
||||
shop.favicon = True
|
||||
|
||||
if file_key == "shop-logo-banner":
|
||||
shop.logo_banner = True
|
||||
|
||||
# redirect back to this page to clear
|
||||
# the params posted by the s3 webhooks.
|
||||
return HTTPFound("/s/{}/{}/settings?uploaded={}".format(shop.id, shop.slug, file_key))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue