fix: use PUT (not PATCH) for Supabase admin user_metadata update

Supabase Auth admin API requires PUT /auth/v1/admin/users/{id} to update
a user record — PATCH returns 405. Corrects the seed step that sets
kcar's user_type to 'platform_admin'.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
kcar 2026-05-27 04:23:59 +01:00
parent 035ea17844
commit 9c32887407

View File

@ -395,7 +395,7 @@ def seed() -> Dict[str, Any]:
# Fix kcar's auth user_metadata so user_type is "platform_admin", not "teacher". # Fix kcar's auth user_metadata so user_type is "platform_admin", not "teacher".
# Without this, POST /user/init assigns kcar to the default school on first login. # Without this, POST /user/init assigns kcar to the default school on first login.
try: try:
r = requests.patch( r = requests.put(
f"{url}/auth/v1/admin/users/{KCAR_ID}", f"{url}/auth/v1/admin/users/{KCAR_ID}",
headers=headers, headers=headers,
json={"user_metadata": {"user_type": "platform_admin"}}, json={"user_metadata": {"user_type": "platform_admin"}},