1
This commit is contained in:
parent
b5f277500f
commit
cd80ae04ec
@ -4,6 +4,7 @@ from sqlalchemy import select, func
|
||||
from sqlalchemy.orm import selectinload
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
|
||||
from app.core.auth import hash_password
|
||||
from app.db.models import ClassMembership, Class_, User
|
||||
|
||||
|
||||
@ -85,7 +86,8 @@ async def import_members(
|
||||
placeholder_email = f"inactive+{class_id}.{sid}@member.local"
|
||||
new_user = User(
|
||||
email=placeholder_email,
|
||||
password_hash=None,
|
||||
# Keep inactive imports compatible with older schemas where password_hash is NOT NULL.
|
||||
password_hash=hash_password(secrets.token_urlsafe(24)),
|
||||
name=name,
|
||||
student_id=sid,
|
||||
role="student",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user