-
-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add sync_kobocat_form_media
management command
#3226
Merged
Merged
Conversation
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
…and allow for verbosity control in output
noliveleger
requested changes
May 25, 2021
Base automatically changed from
2487-form-media-alphabetized-methods
to
2487-form-media
June 2, 2021 18:37
…()` rather than `print()`
…filtering, skip sync if from_kpi is already True, refactor
@joshuaberetta I think I would rename the management command |
noliveleger
reviewed
Jun 10, 2021
noliveleger
reviewed
Jun 10, 2021
sync_form_media
management commandsync_kobocat_form_media
management command
noliveleger
approved these changes
Jun 10, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
sync_kobocat_form_media
The
sync_kobocat_form_media
command can take several optional arguments:--username
:string
(defaultNone
),--asset-uid
:string
(defaultNone
),--verbosity
,int
in{0, 1, 2, 3}
(default1
), and--quiet
:bool
(defaultFalse
)With those arguments, the following behaviour can be expected:
Asset
s will attempt to sync;username
: only the assets that the user owns will have their media synced;asset_uid
: only the asset with the UID provided will sync;verbosity
:0
or1
: minimal output stats,2
: an array containing stats for each asset sync included,3
: an additional array with the filenames and IDs that have been syncedquiet
: no outputsync_kobocat_xforms
Since
sync_kobocat_form_media
will only sync for assets that exist in KPI,sync_kobocat_xforms
can now be run with the additional argument of--sync-form-media
(defaults toTrue
, run with--no-sync-form-media
to turn off) when ausername
is provided. This will sync that user's forms from kobocat to KPI while additionally syncing the form-media from kobocat.The
/migrate
endpoint will now also callsync_kobocat_xforms
with the option ofsync_kobocat_form_media
set toTrue
.Description
Management command,
sync_kobocat_form_media
, created to allow for form-media from kobocat to be synced with KPI's replacement model.Related issues
closes #2675