From 4feb1203660c6d5f19d8f9e6cf7e878401f38bbb Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Tue, 29 Sep 2020 13:26:59 +0200 Subject: [PATCH] Fix add link --- pynyaata/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pynyaata/__init__.py b/pynyaata/__init__.py index 0792d75..79aa820 100644 --- a/pynyaata/__init__.py +++ b/pynyaata/__init__.py @@ -155,6 +155,7 @@ def admin_edit(link_id=None): folder = folder if folder else AnimeFolder() folder.name = form.folder.data db.session.add(folder) + db.session.commit() # Title link = AnimeLink.query.filter_by(id=form.id.data).first() link = link if link else AnimeLink() @@ -165,6 +166,7 @@ def admin_edit(link_id=None): title.name = form.name.data title.keyword = form.keyword.data.lower() if form.keyword.data else title.keyword db.session.add(title) + db.session.commit() # Link link.title_id = title.id link.link = form.link.data @@ -173,6 +175,7 @@ def admin_edit(link_id=None): link.vf = form.is_vf.data db.session.add(link) db.session.commit() + remove_garbage(link) return redirect(url_for('admin')) if link_id: