Skip to content

Commit

Permalink
fix incorrect is_server logic
Browse files Browse the repository at this point in the history
  • Loading branch information
ozer550 authored and bjester committed Nov 10, 2023
1 parent 7f999c9 commit 4fbb054
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
7 changes: 4 additions & 3 deletions kolibri/core/auth/kolibri_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,19 @@ def handle_initial(self, context):
sync_filter = str(context.filter)
is_server = context.is_server
instance_id = str(
context.sync_session.server_instance_id
context.sync_session.client_instance_id
if context.is_server
else context.sync_session.client_instance_id
else context.sync_session.server_instance_id
)

instance_name = "client" if is_server else "server"
cleanupsync.enqueue(
kwargs=dict(
is_pull=is_pull,
is_push=is_push,
sync_filter=sync_filter,
is_server=is_server,
instance_id=instance_id,
instance_name=instance_name
)
)
return False
Expand Down
6 changes: 2 additions & 4 deletions kolibri/core/auth/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -612,12 +612,10 @@ def cleanupsync(**kwargs):
is_pull = kwargs.get("is_pull")
is_push = kwargs.get("is_push")
sync_filter = kwargs.get("sync_filter")
is_server = kwargs.get("is_server")
instance_id = kwargs.get("instance_id")
instance_name = "client" if is_server else "server"
instance_attribute_name = "{}-instance-id".format(instance_name)
instance_name = kwargs.get("instance_name")
instance_attribute = {
instance_attribute_name: instance_id,
"{}-instance-id".format(instance_name): instance_id,
}
if (
is_pull is not None
Expand Down

0 comments on commit 4fbb054

Please sign in to comment.