Revert flush - address later

This commit is contained in:
Andrii V 2025-11-04 14:49:12 +01:00
parent d290857d31
commit 4b2af413dd

View file

@ -609,10 +609,6 @@ 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