Skip to content

Refactor redundant user deletion logic in users.py#2253

Open
raphaeltannous wants to merge 2 commits intofastapi:masterfrom
raphaeltannous:fix/cascade-delete-redundancy
Open

Refactor redundant user deletion logic in users.py#2253
raphaeltannous wants to merge 2 commits intofastapi:masterfrom
raphaeltannous:fix/cascade-delete-redundancy

Conversation

@raphaeltannous
Copy link
Copy Markdown

Hey!

Removed redundant manual item deletion in the user deletion endpoint, since the SQLModel relationship already has ON DELETE CASCADE configured, which automatically deletes all related items when a user is deleted.

owner_id: uuid.UUID = Field(
foreign_key="user.id", nullable=False, ondelete="CASCADE"
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants