Repository: vantage6/vantage6
Issue: [Bug] Backwards compatibility initiating organization of task

**Describe the bug**
In 3.5 we have added a field which users initiate which tasks which led to renaming of the initating org field in several places. It turns out that now, a node of v3.4 is not compatible with v3.5 server e.g. when creating a task. This should be resolved

Changed files:
vantage6-client/vantage6/client/__init__.py, vantage6-server/vantage6/server/resource/task.py, vantage6-node/vantage6/node/__init__.py, vantage6-server/vantage6/server/model/task.py, vantage6-server/vantage6/server/model/organization.py, vantage6-server/vantage6/server/controller/fixture.py

diff --git a/vantage6-client/vantage6/client/__init__.py b/vantage6-client/vantage6/client/__init__.py
index ea61d7d8..f67feb6d 100644
--- a/vantage6-client/vantage6/client/__init__.py
+++ b/vantage6-client/vantage6/client/__init__.py
@@ -1661,7 +1661,7 @@ class UserClient(ClientBase):
             return self.parent.request(f'task/{id_}', params=params)
 
         @post_filtering()
-        def list(self, initiating_org: int = None, initiating_user: int = None,
+        def list(self, initiator: int = None, initiating_user: int = None,
                  collaboration: int = None, image: str = None,
                  parent: int = None, run: int = None,
                  name: str = None, include_results: bool = False,
@@ -1676,7 +1676,7 @@ class UserClient(ClientBase):
                 Filter by the name of the task. It will match with a
                 Like operator. I.e. E% will search for task names that
                 start with an 'E'.
-            initiating_org: int, optional
+            initiator: int, optional
                 Filter by initiating organization
             initiating_user: int, optional
                 Filter by initiating user
@@ -1722,8 +1722,11 @@ class UserClient(ClientBase):
             """
             # if the param is None, it will not be passed on to the
             # request
+            # TODO in v4+, we should change the 'initiator' argument to
+            # a name that distinguishes it better from the initiating user.
+            # Then, we should also change it in the server
             params = {
-                'init_org_id': initiating_org, 'init_user_id': initiating_user,
+                'initiator_id': initiator, 'init_user_id': initiating_user,
                 'collaboration_id': collaboration,
                 'image': image, 'parent_id': parent, 'run_id': run,
                 'name': name, 'page': page, 'per_page': per_page,
diff --git a/vantage6-node/vantage6/node/__init__.py b/vantage6-node/vantage6/node/__init__.py
index f627ef72..46f45511 100644
--- a/vantage6-node/vantage6/node/__init__.py
+++ b/vantage6-node/vantage6/node/__init__.py
@@ -436,8 +436,8 @@ class Node(object):
                     return
 
                 response = self.server_io.request(f"task/{task_id}")
-                init_org_id = response.get("init_org")
 
+                init_org_id = response.get("initiator")
                 if not init_org_id:
                     self.log.error(
                         f"Initiator organization from task (id={task_id})could"
diff --git a/vantage6-server/vantage6/server/controller/fixture.py b/vantage6-server/vantage6/server/controller/fixture.py
index 0a7ae776..78515161 100644
--- a/vantage6-server/vantage6/server/controller/fixture.py
+++ b/vantage6-server/vantage6/server/controller/fixture.py
@@ -58,7 +58,8 @@ def load(fixtures, drop_all=False):
     for col in fixtures.get("collaborations", {}):
 
         # create collaboration
-        collaboration = db.Collaboration(name=col.get("name"), encrypted=col.get("encrypted", True))
+        collaboration = db.Collaboration(
+            name=col.get("name"), encrypted=col.get("encrypted", True))
         log.debug(f"processed collaboration={collaboration.name}")
 
         # append organizations to the collaboration
@@ -105,7 +106,7 @@ def load(fixtures, drop_all=False):
                 image=image,
                 collaboration=collaboration,
                 run_id=db.Task.next_run_id(),
-                init_org=init_org
+                initiator=init_org
             )
 
             for organization in collaboration.organizations:
diff --git a/vantage6-server/vantage6/server/model/organization.py b/vantage6-server/vantage6/server/model/organization.py
index 2f7a2959..9544d7dc 100644
--- a/vantage6-server/vantage6/server/model/organization.py
+++ b/vantage6-server/vantage6/server/model/organization.py
@@ -32,7 +32,7 @@ class Organization(Base):
     results = relationship("Result", back_populates="organization")
     nodes = relationship("Node", back_populates="organization")
     users = relationship("User", back_populates="organization")
-    created_tasks = relationship("Task", back_populates="init_org")
+    created_tasks = relationship("Task", back_populates="initiator")
     roles = relationship("Role", back_populates="organization")
 
     def get_result_ids(self):
diff --git a/vantage6-server/vantage6/server/model/task.py b/vantage6-server/vantage6/server/model/task.py
index 95ddd997..47ba5d21 100644
--- a/vantage6-server/vantage6/server/model/task.py
+++ b/vantage6-server/vantage6/server/model/task.py
@@ -31,7 +31,9 @@ class Task(Base):
     collaboration = relationship("Collaboration", back_populates="tasks")
     parent = relationship("Task", remote_side="Task.id", backref="children")
     results = relationship("Result", back_populates="task")
-    init_org = relationship("Organization", back_populates="created_tasks")
+    # TODO in v4, rename the 'initiator' column so that there is a clear
+    # distinction between initiating organization and user
+    initiator = relationship("Organization", back_populates="created_tasks")
     init_user = relationship("User", back_populates="created_tasks")
 
     @hybrid_property
diff --git a/vantage6-server/vantage6/server/resource/task.py b/vantage6-server/vantage6/server/resource/task.py
index 9d2760b6..b244b547 100644
--- a/vantage6-server/vantage6/server/resource/task.py
+++ b/vantage6-server/vantage6/server/resource/task.py
@@ -372,7 +372,7 @@ class Tasks(TaskBase):
         task = db.Task(collaboration=collaboration, name=data.get('name', ''),
                        description=data.get('description', ''), image=image,
                        database=data.get('database', ''),
-                       init_org=init_org)
+                       initiator=init_org)
 
         # create run_id. Users can only create top-level -tasks (they will not
         # have sub-tasks). Therefore, always create a new run_id. Tasks created