summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDashie <dashie@sigpipe.me>2021-02-24 08:26:33 +0100
committerDashie <dashie@sigpipe.me>2021-02-24 08:26:33 +0100
commit9ccb8ece4c6cb6494030de2cc86e72441cae1ea1 (patch)
tree940afebdb4c978884bdfcf60cacd3e1804e74dd9
parentf1d7e44b1efcf2eb412b4b636328768503d1ec51 (diff)
meh
-rw-r--r--api/controllers/api/v1/accounts.py2
-rw-r--r--api/migrations/versions/68_dff4edfb26b6_.py41
2 files changed, 43 insertions, 0 deletions
diff --git a/api/controllers/api/v1/accounts.py b/api/controllers/api/v1/accounts.py
index 0ee3ad47..b7fac730 100644
--- a/api/controllers/api/v1/accounts.py
+++ b/api/controllers/api/v1/accounts.py
@@ -31,6 +31,7 @@ from utils.defaults import Reel2bitsDefaults
from flask_uploads import UploadSet
import os
import little_boxes.activitypub as ap
+import uuid
bp_api_v1_accounts = Blueprint("bp_api_v1_accounts", __name__)
@@ -149,6 +150,7 @@ def accounts():
display_name=request.json["fullname"],
password=hash_password(request.json["password"]),
roles=[role],
+ fs_identifier=uuid.uuid4(),
)
actor = create_actor(u)
diff --git a/api/migrations/versions/68_dff4edfb26b6_.py b/api/migrations/versions/68_dff4edfb26b6_.py
new file mode 100644
index 00000000..8d74d34d
--- /dev/null
+++ b/api/migrations/versions/68_dff4edfb26b6_.py
@@ -0,0 +1,41 @@
+"""Migrate to client_metadata
+
+Revision ID: dff4edfb26b6
+Revises: 7df5c87e5fef
+Create Date: 2021-02-23 22:59:23.112766
+
+"""
+
+# revision identifiers, used by Alembic.
+revision = "dff4edfb26b6"
+down_revision = "7df5c87e5fef"
+
+from alembic import op # noqa: E402
+import sqlalchemy as sa # noqa: E402
+
+
+def upgrade():
+ # ### commands auto generated by Alembic - please adjust! ###
+ op.drop_column("oauth2_client", "redirect_uri")
+ op.drop_column("oauth2_client", "client_uri")
+ op.drop_column("oauth2_client", "response_type")
+ op.drop_column("oauth2_client", "client_name")
+ op.drop_column("oauth2_client", "grant_type")
+ op.drop_column("oauth2_client", "token_endpoint_auth_method")
+ op.drop_column("oauth2_client", "scope")
+ # ### end Alembic commands ###
+
+
+def downgrade():
+ # ### commands auto generated by Alembic - please adjust! ###
+ op.add_column("oauth2_client", sa.Column("scope", sa.TEXT(), autoincrement=False, nullable=False))
+ op.add_column(
+ "oauth2_client",
+ sa.Column("token_endpoint_auth_method", sa.VARCHAR(length=48), autoincrement=False, nullable=True),
+ )
+ op.add_column("oauth2_client", sa.Column("grant_type", sa.TEXT(), autoincrement=False, nullable=False))
+ op.add_column("oauth2_client", sa.Column("client_name", sa.VARCHAR(length=100), autoincrement=False, nullable=True))
+ op.add_column("oauth2_client", sa.Column("response_type", sa.TEXT(), autoincrement=False, nullable=False))
+ op.add_column("oauth2_client", sa.Column("client_uri", sa.TEXT(), autoincrement=False, nullable=True))
+ op.add_column("oauth2_client", sa.Column("redirect_uri", sa.TEXT(), autoincrement=False, nullable=True))
+ # ### end Alembic commands ###