mirror of
https://github.com/Xevion/simple-viewer.git
synced 2025-12-07 20:08:30 -06:00
fix thumbnail deletion not occurring due to nonexistent file
This commit is contained in:
@@ -148,10 +148,12 @@ class File(models.Model):
|
||||
if self.thumbnail:
|
||||
try:
|
||||
os.remove(os.path.join(self.thumbs_dir, self.thumbnail))
|
||||
self.thumbnail = None
|
||||
self.save()
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
finally:
|
||||
self.thumbnail = None
|
||||
self.save()
|
||||
|
||||
|
||||
@property
|
||||
def thumbnail_static_path(self):
|
||||
|
||||
Reference in New Issue
Block a user