diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ae20c201..0af81f27 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,5 @@ repos: -- repo: https://github.com/ambv/black +- repo: https://github.com/psf/black rev: stable hooks: - id: black diff --git a/app/dashboard/templates/dashboard/mailbox_detail.html b/app/dashboard/templates/dashboard/mailbox_detail.html index 437fd070..6c306136 100644 --- a/app/dashboard/templates/dashboard/mailbox_detail.html +++ b/app/dashboard/templates/dashboard/mailbox_detail.html @@ -64,8 +64,6 @@ - - {% if current_user.can_use_pgp %}
@@ -91,8 +89,6 @@
- {% endif %} - {% endblock %} diff --git a/app/dashboard/views/mailbox_detail.py b/app/dashboard/views/mailbox_detail.py index 32cf8f13..ae663396 100644 --- a/app/dashboard/views/mailbox_detail.py +++ b/app/dashboard/views/mailbox_detail.py @@ -100,12 +100,6 @@ def mailbox_detail_route(mailbox_id): url_for("dashboard.mailbox_detail_route", mailbox_id=mailbox_id) ) elif request.form.get("form-name") == "pgp": - if not current_user.can_use_pgp: - flash("You cannot use PGP", "error") - return redirect( - url_for("dashboard.mailbox_detail_route", mailbox_id=mailbox_id) - ) - if request.form.get("action") == "save": mailbox.pgp_public_key = request.form.get("pgp") try: diff --git a/app/models.py b/app/models.py index 82535b56..9b2d0ee3 100644 --- a/app/models.py +++ b/app/models.py @@ -143,11 +143,6 @@ class User(db.Model, ModelMixin, UserMixin): db.ForeignKey("mailbox.id"), nullable=True, default=None ) - # feature flag - can_use_pgp = db.Column( - db.Boolean, default=False, nullable=False, server_default="0" - ) - profile_picture = db.relationship(File) @classmethod diff --git a/migrations/versions/2020_031621_91b69dfad2f1_.py b/migrations/versions/2020_031621_91b69dfad2f1_.py new file mode 100644 index 00000000..188797fc --- /dev/null +++ b/migrations/versions/2020_031621_91b69dfad2f1_.py @@ -0,0 +1,38 @@ +"""empty message + +Revision ID: 91b69dfad2f1 +Revises: 9081f1a90939 +Create Date: 2020-03-16 21:15:48.652860 + +""" +import sqlalchemy_utils +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = "91b69dfad2f1" +down_revision = "9081f1a90939" +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_column("users", "can_use_pgp") + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.add_column( + "users", + sa.Column( + "can_use_pgp", + sa.BOOLEAN(), + server_default=sa.text("false"), + autoincrement=False, + nullable=False, + ), + ) + # ### end Alembic commands ### diff --git a/server.py b/server.py index 24c27d0f..4668120d 100644 --- a/server.py +++ b/server.py @@ -131,7 +131,6 @@ def fake_data(): activated=True, is_admin=True, otp_secret="base32secret3232", - can_use_pgp=True, ) db.session.commit()