Self-service avatar picker in Account

Users can now set their own profile picture instead of asking staff:
POST /api/auth/avatar/ accepts a J-ID (or blank to clear) and reuses the
same item resolution as the staff endpoint. The Account page gains a
profile picture card with a searchable, paginated library grid — any
item works (the thumbnail is used), the current avatar is marked, and
the choice is confirmed before saving. Refreshing the signed-in user
updates the shell avatar immediately.

Verified against the dev server: set, clear, unknown J-ID -> 400,
anonymous -> 401.
This commit is contained in:
2026-09-17 22:31:05 -05:00
parent d8ba442e72
commit 3c49d2be2e
5 changed files with 313 additions and 19 deletions
+2 -1
View File
@@ -1,12 +1,13 @@
from django.urls import path
from rest_framework.authtoken.views import obtain_auth_token
from .views import E621CredentialsView, LogoutView, MeView, RegisterView
from .views import AvatarView, E621CredentialsView, LogoutView, MeView, RegisterView
urlpatterns = [
path("register/", RegisterView.as_view(), name="register"),
path("token/", obtain_auth_token, name="login"),
path("logout/", LogoutView.as_view(), name="logout"),
path("me/", MeView.as_view(), name="me"),
path("avatar/", AvatarView.as_view(), name="avatar"),
path("e621/", E621CredentialsView.as_view(), name="e621_credentials"),
]