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
@@ -20,6 +20,17 @@ class UserSchema(Schema):
|
||||
username = fields.String(dump_only=True, metadata={"example": "alice"})
|
||||
email = fields.String(dump_only=True, metadata={"example": "alice@example.com"})
|
||||
created_at = fields.DateTime(dump_only=True)
|
||||
has_avatar = fields.Boolean(
|
||||
dump_only=True, metadata={"description": "Whether you have a profile image"}
|
||||
)
|
||||
avatar_source = fields.String(
|
||||
dump_only=True,
|
||||
validate=validate.OneOf(["none", "upload", "gravatar"]),
|
||||
metadata={"description": "Where your profile image comes from"},
|
||||
)
|
||||
avatar_updated_at = fields.DateTime(
|
||||
dump_only=True, allow_none=True, metadata={"description": "When it last changed"}
|
||||
)
|
||||
|
||||
|
||||
class RegisterSchema(Schema):
|
||||
@@ -164,6 +175,10 @@ class AlbumArtUploadSchema(Schema):
|
||||
file = Upload(required=True, metadata={"description": "A JPEG, PNG or WebP image"})
|
||||
|
||||
|
||||
class AvatarUploadSchema(Schema):
|
||||
file = Upload(required=True, metadata={"description": "A JPEG, PNG or WebP image"})
|
||||
|
||||
|
||||
class AlbumArtCorrectionSchema(AlbumArtArgsSchema):
|
||||
search_artist = fields.String(
|
||||
validate=validate.Length(min=1, max=500),
|
||||
|
||||
Reference in new issue
Block a user