mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-06-19 09:13:53 +00:00
Small adjustment on sign_out function (#603)
* Small adjustment on sing_out function First, thanks for this. It has been a great help. I was having trouble with this function, getting a TypeError (TypeError: can only concatenate str (not "NoneType") to str) because apparently the second os.remove(session_cache_path()) is trying to delete a file that does not exist anymore so this is what worked for me. * Change description on app.py file * Update app.py on line 79 Fixed indent
This commit is contained in:
parent
8198947428
commit
3f2592d631
@ -8,7 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## Unreleased
|
||||
|
||||
// Add your changes here and then delete this line
|
||||
### Changed
|
||||
- moved os.remove(session_cache_path()) inside try block to avoid TypeError on app.py example file
|
||||
|
||||
## [2.16.1] - 2020-10-24
|
||||
|
||||
|
||||
@ -73,11 +73,10 @@ def index():
|
||||
|
||||
@app.route('/sign_out')
|
||||
def sign_out():
|
||||
os.remove(session_cache_path())
|
||||
session.clear()
|
||||
try:
|
||||
# Remove the CACHE file (.cache-test) so that a new user can authorize.
|
||||
os.remove(session_cache_path())
|
||||
session.clear()
|
||||
except OSError as e:
|
||||
print ("Error: %s - %s." % (e.filename, e.strerror))
|
||||
return redirect('/')
|
||||
|
||||
Loading…
Reference in New Issue
Block a user