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:
parent
17aead2e21
commit
04333d210b
3 changed files with 31 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue