mirror of
https://github.com/simple-login/app.git
synced 2024-09-20 06:55:59 +08:00
Open PGP to everyone
This commit is contained in:
parent
8faf34ce40
commit
ea43b8f685
|
@ -1,5 +1,5 @@
|
|||
repos:
|
||||
- repo: https://github.com/ambv/black
|
||||
- repo: https://github.com/psf/black
|
||||
rev: stable
|
||||
hooks:
|
||||
- id: black
|
||||
|
|
|
@ -64,8 +64,6 @@
|
|||
<!-- END Change email -->
|
||||
|
||||
|
||||
<!-- Change PGP Public key -->
|
||||
{% if current_user.can_use_pgp %}
|
||||
<div class="card">
|
||||
<form method="post">
|
||||
<input type="hidden" name="form-name" value="pgp">
|
||||
|
@ -91,8 +89,6 @@
|
|||
</form>
|
||||
|
||||
</div>
|
||||
{% endif %}
|
||||
<!-- END PGP Public key -->
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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
|
||||
|
|
38
migrations/versions/2020_031621_91b69dfad2f1_.py
Normal file
38
migrations/versions/2020_031621_91b69dfad2f1_.py
Normal file
|
@ -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 ###
|
Loading…
Reference in a new issue