bito-code-review[bot] commented on PR #42211:
URL: https://github.com/apache/superset/pull/42211#issuecomment-5025435616

   <!-- Bito Reply -->
   Yes, your understanding is correct. The previous implementation was 
incorrectly filtering by the token's primary key (`DatabaseUserOAuth2Tokens.id 
== self.id`), which meant it would only delete a single token (if any) matching 
that ID. The updated code correctly filters by `database_id` 
(`DatabaseUserOAuth2Tokens.database_id == self.id`), ensuring that all tokens 
associated with that specific database connection are purged.
   
   **superset/models/core.py**
   ```
   db.session.query(DatabaseUserOAuth2Tokens).filter(
   -            DatabaseUserOAuth2Tokens.id == self.id
   +            DatabaseUserOAuth2Tokens.database_id == self.id
           ).delete()
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to