From 1073d2c1eaf9c77088410990dd766f3fa405eaaa Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Sat, 10 Jul 2021 23:45:48 +0200 Subject: [PATCH] Fix title --- pynyaata/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pynyaata/__init__.py b/pynyaata/__init__.py index 306e36d..3459835 100644 --- a/pynyaata/__init__.py +++ b/pynyaata/__init__.py @@ -211,7 +211,8 @@ def admin_edit(link_id=None): instance = get_instance(form.link.data) # Title - title = AnimeTitle.query.filter_by(name=form.name.data).first() + title = AnimeTitle.query.filter_by(id=link.title_id).first() + title = title if title else AnimeTitle.query.filter_by(name=form.name.data).first() title = title if title else AnimeTitle() title.folder_id = form.folder.data title.name = form.name.data