changeset 8510:22876c6818d2 stable

api: fix repo creation from API when using celery Repo creation would fail when celery tried serializing a whole User object. It only worked when not using celery.
author Mads Kiilerich <mads@kiilerich.com>
date Mon, 14 Dec 2020 01:46:54 +0100
parents f950740985f4
children af8ed8e6714e
files kallithea/controllers/api/api.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/controllers/api/api.py	Mon Dec 14 23:18:07 2020 +0100
+++ b/kallithea/controllers/api/api.py	Mon Dec 14 01:46:54 2020 +0100
@@ -1276,7 +1276,7 @@
                 repo_copy_permissions=copy_permissions,
             )
 
-            task = RepoModel().create(form_data=data, cur_user=owner)
+            task = RepoModel().create(form_data=data, cur_user=owner.username)
             task_id = task.task_id
             # no commit, it's done in RepoModel, or async via celery
             return dict(
@@ -1450,7 +1450,7 @@
                 update_after_clone=False,
                 fork_parent_id=repo.repo_id,
             )
-            task = RepoModel().create_fork(form_data, cur_user=owner)
+            task = RepoModel().create_fork(form_data, cur_user=owner.username)
             # no commit, it's done in RepoModel, or async via celery
             task_id = task.task_id
             return dict(