Delegate user persistence to UserRepository

- Add create() and update() methods to UserRepository
- Update ProfileService to use repository.update()
- Update AuthService to use repository.create()
This commit is contained in:
counterweight 2025-12-25 18:52:23 +01:00
parent 17aead2e21
commit 04333d210b
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C
3 changed files with 31 additions and 4 deletions

View file

@ -72,8 +72,8 @@ class AuthService:
if default_role:
user.roles.append(default_role)
self.db.add(user)
await self.db.flush() # Get user ID
# Create user (flush to get ID)
user = await self.user_repo.create(user)
# Mark invite as spent
invite.status = InviteStatus.SPENT