Skip to content

Commit af816b8

Browse files
committed
Prevent sync from provisioning the device and clear task on deprovision
1 parent bd35f6a commit af816b8

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

kolibri/core/auth/utils/deprovision.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from kolibri.core.logger.models import AttemptLog
1414
from kolibri.core.logger.models import ContentSessionLog
1515
from kolibri.core.logger.models import ContentSummaryLog
16+
from kolibri.core.tasks.main import job_storage
1617

1718
MODELS_TO_DELETE = [
1819
AttemptLog,
@@ -38,6 +39,9 @@ def deprovision(progress_update=None):
3839
if progress_update:
3940
progress_update(1)
4041

42+
# Clear all completed, failed or cancelled jobs
43+
job_storage.clear()
44+
4145

4246
def get_deprovision_progress_total():
4347
return len(MODELS_TO_DELETE)

kolibri/core/device/soud.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,7 @@ def execute_sync(context):
386386
baseurl=context.network_location.base_url,
387387
keep_alive=True,
388388
noninteractive=True,
389+
no_provision=True,
389390
)
390391

391392
if sync_session_id:

0 commit comments

Comments
 (0)