Merge pull request !2852 from rhodecode-enterprise-ce fix/user-deletion-repo-groups-null-constraint
User deletion fix
This commit is contained in:
commit
814961065b
1 changed files with 4 additions and 0 deletions
|
|
@ -609,6 +609,10 @@ class UserModel(BaseModel):
|
|||
if detach_artifacts:
|
||||
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
|
||||
|
||||
# we might change the user data with detach/delete, make sure
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue