From 93c7498a83b475efe0a8abfccabc9039b8c2728d Mon Sep 17 00:00:00 2001 From: Thomas Peetz Date: Mon, 27 Jan 2025 15:20:35 +0100 Subject: [PATCH] setting return value of adding link to db --- python/kontor-schema/kontor_schema/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/kontor-schema/kontor_schema/__init__.py b/python/kontor-schema/kontor_schema/__init__.py index bb1db87..74f672a 100644 --- a/python/kontor-schema/kontor_schema/__init__.py +++ b/python/kontor-schema/kontor_schema/__init__.py @@ -263,7 +263,7 @@ class KontorDB: return existing_ids def add_entry(self, table_name: str, update_item: dict): - # self.log.info("add entry to table %s with %s", table_name, update_item) + self.log.debug("add entry to table %s with %s", table_name, update_item) __session__ = sessionmaker(self.engine) with __session__() as session: add_item = self.registry[table_name]() @@ -307,7 +307,7 @@ class KontorDB: try: session.add(media_file) session.commit() - result['added'] = media_file + result['added'] = {'url': media_file.url, 'title': media_file.title, 'review': media_file.review, 'download': media_file.should_download} except IntegrityError as error: session.rollback() result['error'] = error.orig