User deletion fix
This commit is contained in:
parent
7d2a9d1d48
commit
7b315a1001
1 changed files with 4 additions and 0 deletions
|
|
@ -601,6 +601,10 @@ class UserModel(BaseModel):
|
||||||
if detach_artifacts:
|
if detach_artifacts:
|
||||||
self._detach_user_artifacts(user.username, user.artifacts, new_owner)
|
self._detach_user_artifacts(user.username, user.artifacts, new_owner)
|
||||||
|
|
||||||
|
# Flush all detach operations to database before deleting user
|
||||||
|
# Ensures foreign keys are properly updated and prevents NULL constraint violations
|
||||||
|
self.sa.flush()
|
||||||
|
|
||||||
user_data = user.get_dict() # fetch user data before expire
|
user_data = user.get_dict() # fetch user data before expire
|
||||||
|
|
||||||
# we might change the user data with detach/delete, make sure
|
# we might change the user data with detach/delete, make sure
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue