Changeset - 22876c6818d2
[Not reviewed]
stable
0 1 0
Mads Kiilerich (kiilerix) - 4 years ago 2020-12-14 00:46:54
mads@kiilerich.com
Grafted from: 47cc76de50be
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.
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general) First comment
kallithea/controllers/api/api.py
Show inline comments
 
@@ -1276,7 +1276,7 @@ class ApiController(JSONRPCController):
 
                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 @@ class ApiController(JSONRPCController):
 
                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(
0 comments (0 inline, 0 general) First comment
You need to be logged in to comment. Login now