mirror of
https://github.com/Derpy-Leggies/OnlyLegs.git
synced 2024-12-28 02:16:07 +00:00
Removed cached copies of profile images
This commit is contained in:
parent
9f09c40ee2
commit
2673026880
|
@ -224,6 +224,10 @@ def user_picture(user_id):
|
|||
|
||||
if user.picture:
|
||||
os.remove(os.path.join(current_app.config["PFP_FOLDER"], user.picture))
|
||||
# Delete cached files
|
||||
cache_name = user.picture.rsplit(".")[0]
|
||||
for cache_file in pathlib.Path(current_app.config["CACHE_FOLDER"]).glob(cache_name + "*"):
|
||||
os.remove(cache_file)
|
||||
|
||||
# Save file
|
||||
try:
|
||||
|
|
Loading…
Reference in a new issue