Add uploaded profile images (SCR-1)
CI / validate-monitoring (push) Successful in 8s
CI / lint (push) Successful in 16s
CI / federation-interop (push) Successful in 1m40s
CI / test (push) Successful in 4m48s
CI / images (push) Skipped
CI / assets (push) Skipped
CI / python-package (push) Skipped
CI / trigger-deploy (push) Skipped
CI / notify (push) Successful in 5s
CI / validate-monitoring (push) Successful in 8s
CI / lint (push) Successful in 16s
CI / federation-interop (push) Successful in 1m40s
CI / test (push) Successful in 4m48s
CI / images (push) Skipped
CI / assets (push) Skipped
CI / python-package (push) Skipped
CI / trigger-deploy (push) Skipped
CI / notify (push) Successful in 5s
Users can upload, fetch and remove a profile image at /api/v1/me/avatar. The bytes live in an avatars folder inside ART_STORAGE_DIR; the users row records the source and content type. Adds metrics, AVATAR_UPLOAD_MAX_BYTES and the regenerated OpenAPI document. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
81e0b0cf42
commit
c55a6596d0
11 files changed
+555
-1
No files matched your search
@@ -0,0 +1,34 @@
|
||||
"""user avatar
|
||||
|
||||
Revision ID: b3e8a5d1f720
|
||||
Revises: c7d2f08a19e4
|
||||
Create Date: 2026-10-13 09:00:00.000000
|
||||
|
||||
"""
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = "b3e8a5d1f720"
|
||||
down_revision = "c7d2f08a19e4"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.add_column(
|
||||
"users",
|
||||
sa.Column("avatar_source", sa.String(length=16), server_default="none", nullable=False),
|
||||
)
|
||||
op.add_column("users", sa.Column("avatar_content_type", sa.String(length=32), nullable=True))
|
||||
op.add_column(
|
||||
"users", sa.Column("avatar_updated_at", sa.DateTime(timezone=True), nullable=True)
|
||||
)
|
||||
|
||||
|
||||
def downgrade():
|
||||
op.drop_column("users", "avatar_updated_at")
|
||||
op.drop_column("users", "avatar_content_type")
|
||||
op.drop_column("users", "avatar_source")
|
||||
Reference in new issue
Block a user