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