-
Notifications
You must be signed in to change notification settings - Fork 634
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8259 from learningequality/release-v0.15.x
Cascade merge release-v0.15.x into develop
- Loading branch information
Showing
13 changed files
with
135 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from kolibri.core.auth.hooks import FacilityDataSyncHook | ||
from kolibri.plugins.hooks import register_hook | ||
|
||
|
||
@register_hook | ||
class UserSyncStatusHook(FacilityDataSyncHook): | ||
def pre_transfer( | ||
self, | ||
dataset_id, | ||
local_is_single_user, | ||
remote_is_single_user, | ||
single_user_id, | ||
context, | ||
): | ||
# if we're about to do a single user sync, update UserSyncStatus accordingly | ||
if context.sync_session and single_user_id is not None: | ||
from kolibri.core.device.models import UserSyncStatus | ||
|
||
UserSyncStatus.objects.update_or_create( | ||
user_id=single_user_id, | ||
defaults={"queued": False, "sync_session": context.sync_session}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.