mirror of
https://github.com/minetest/contentdb.git
synced 2025-01-03 11:47:28 +01:00
Fix crash on deleting failed releases
This commit is contained in:
parent
1d5be80564
commit
954a849ba6
@ -351,6 +351,7 @@ def delete_release(token: APIToken, package: Package, id: int):
|
||||
db.session.delete(release)
|
||||
db.session.commit()
|
||||
|
||||
if release.file_path and os.path.isfile(release.file_path):
|
||||
os.remove(release.file_path)
|
||||
|
||||
return jsonify({"success": True})
|
||||
|
@ -242,6 +242,7 @@ def delete_release(package, id):
|
||||
db.session.delete(release)
|
||||
db.session.commit()
|
||||
|
||||
if release.file_path and os.path.isfile(release.file_path):
|
||||
os.remove(release.file_path)
|
||||
|
||||
return redirect(package.get_url("packages.view"))
|
||||
|
Loading…
Reference in New Issue
Block a user