From 79891063a1300d3d2b6b653f93cc3b38c356e707 Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Fri, 18 Mar 2022 20:00:35 +0000 Subject: [PATCH] Fix deletion on postgres --- pynyaata/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pynyaata/__init__.py b/pynyaata/__init__.py index 1195c68..e825ad9 100644 --- a/pynyaata/__init__.py +++ b/pynyaata/__init__.py @@ -137,7 +137,7 @@ def admin(): form = DeleteForm(request.form) if form.validate_on_submit(): - link = AnimeLink.query.filter_by(id=form.id.data).first() + link = AnimeLink.query.filter_by(id=int(form.id.data)).first() if link: form.message = '%s (%s) has been successfully deleted' % ( link.title.name, @@ -171,7 +171,7 @@ def folder_list(): form = FolderDeleteForm(request.form) if form.validate_on_submit(): - folder = AnimeFolder.query.filter_by(id=form.id.data).first() + folder = AnimeFolder.query.filter_by(id=int(form.id.data)).first() if folder: form.message = '%s has been successfully deleted' % folder.name db.session.delete(folder)