Removed cached copies of profile images

This commit is contained in:
Michał 2023-04-21 16:20:22 +00:00
parent 9f09c40ee2
commit 2673026880

View file

@ -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: