コード例 #1
0
ファイル: model.py プロジェクト: GageGaskins/osf.io
    def revoke_access_token(self):
        # if there is only one osf user linked to this google drive user oauth, revoke the token,
        # otherwise, disconnect the osf user from the googledriveoauthsettings
        if len(self.googledriveusersettings__accessed) <= 1:
            client = GoogleAuthClient()
            try:
                client.revoke(self.access_token)
            except:
                # no need to fail, revoke is opportunistic
                pass

            # remove the object as its the last instance.
            GoogleDriveOAuthSettings.remove_one(self)
コード例 #2
0
ファイル: model.py プロジェクト: lorenanicole/osf.io
    def revoke_access_token(self):
        # if there is only one osf user linked to this google drive user oauth, revoke the token,
        # otherwise, disconnect the osf user from the googledriveoauthsettings
        if len(self.googledriveusersettings__accessed) <= 1:
            client = GoogleAuthClient()
            try:
                client.revoke(self.access_token)
            except:
                # no need to fail, revoke is opportunistic
                pass

            # remove the object as its the last instance.
            GoogleDriveOAuthSettings.remove_one(self)