Browse Source

remove users.can_use_custom_domain flag

Son NK 5 years ago
parent
commit
c3b716f644
4 changed files with 31 additions and 8 deletions
  1. 0 5
      app/models.py
  2. 29 0
      migrations/versions/0c7f1a48aac9_.py
  3. 0 1
      server.py
  4. 2 2
      templates/header.html

+ 0 - 5
app/models.py

@@ -95,11 +95,6 @@ class User(db.Model, ModelMixin, UserMixin):
 
     profile_picture_id = db.Column(db.ForeignKey(File.id), nullable=True)
 
-    # feature flag
-    can_use_custom_domain = db.Column(
-        db.Boolean, nullable=False, default=False, server_default="0"
-    )
-
     profile_picture = db.relationship(File)
 
     @classmethod

+ 29 - 0
migrations/versions/0c7f1a48aac9_.py

@@ -0,0 +1,29 @@
+"""empty message
+
+Revision ID: 0c7f1a48aac9
+Revises: 2d2fc3e826af
+Create Date: 2019-12-15 21:49:02.167122
+
+"""
+import sqlalchemy_utils
+from alembic import op
+import sqlalchemy as sa
+
+
+# revision identifiers, used by Alembic.
+revision = '0c7f1a48aac9'
+down_revision = '2d2fc3e826af'
+branch_labels = None
+depends_on = None
+
+
+def upgrade():
+    # ### commands auto generated by Alembic - please adjust! ###
+    op.drop_column('users', 'can_use_custom_domain')
+    # ### end Alembic commands ###
+
+
+def downgrade():
+    # ### commands auto generated by Alembic - please adjust! ###
+    op.add_column('users', sa.Column('can_use_custom_domain', sa.BOOLEAN(), server_default=sa.text('false'), autoincrement=False, nullable=False))
+    # ### end Alembic commands ###

+ 0 - 1
server.py

@@ -99,7 +99,6 @@ def fake_data():
         password="password",
         activated=True,
         is_admin=True,
-        can_use_custom_domain=True,
     )
     db.session.commit()
 

+ 2 - 2
templates/header.html

@@ -50,9 +50,9 @@
               <i class="dropdown-icon fe fe-chrome"></i> API Key
             </a>
 
-            {% if current_user.can_use_custom_domain %}
+            {% if current_user.is_premium() %}
               <a class="dropdown-item" href="{{ url_for('dashboard.custom_domain') }}">
-                <i class="dropdown-icon fe fe-server"></i> Custom Domains
+                <i class="dropdown-icon fe fe-server"></i> Custom Domains <span class="badge badge-info">Beta</span>
               </a>
             {% endif %}