mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-23 14:32:25 +01:00
Fix not being able to delete cover image
This commit is contained in:
parent
fc3a481e6f
commit
dfa5d0c5a7
@ -157,6 +157,10 @@ def delete_screenshot(package, id):
|
|||||||
flash("Permission denied", "danger")
|
flash("Permission denied", "danger")
|
||||||
return redirect(url_for("homepage.home"))
|
return redirect(url_for("homepage.home"))
|
||||||
|
|
||||||
|
if package.cover_image == screenshot:
|
||||||
|
package.cover_image = None
|
||||||
|
db.session.merge(package)
|
||||||
|
|
||||||
db.session.delete(screenshot)
|
db.session.delete(screenshot)
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user