mirror of
https://github.com/apache/superset.git
synced 2026-04-23 10:04:45 +00:00
chore(dao/command): Add transaction decorator to try to enforce "unit of work" (#24969)
This commit is contained in:
@@ -1410,7 +1410,7 @@ class DatabaseRestApi(BaseSupersetModelRestApi):
|
||||
database_id=state["database_id"],
|
||||
)
|
||||
if existing:
|
||||
DatabaseUserOAuth2TokensDAO.delete([existing], commit=True)
|
||||
DatabaseUserOAuth2TokensDAO.delete([existing])
|
||||
|
||||
# store tokens
|
||||
expiration = datetime.now() + timedelta(seconds=token_response["expires_in"])
|
||||
@@ -1422,7 +1422,6 @@ class DatabaseRestApi(BaseSupersetModelRestApi):
|
||||
"access_token_expiration": expiration,
|
||||
"refresh_token": token_response.get("refresh_token"),
|
||||
},
|
||||
commit=True,
|
||||
)
|
||||
|
||||
# return blank page that closes itself
|
||||
|
||||
Reference in New Issue
Block a user