Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
7e55437d
Commit
7e55437d
authored
Oct 05, 2015
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow retry_failed_photo_verifications to take a list of receipt_ids to retry
parent
e57619b0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
+20
-2
lms/djangoapps/verify_student/management/commands/retry_failed_photo_verifications.py
+20
-2
No files found.
lms/djangoapps/verify_student/management/commands/retry_failed_photo_verifications.py
View file @
7e55437d
...
...
@@ -11,13 +11,31 @@ class Command(BaseCommand):
This method finds those PhotoVerifications with a status of
MUST_RETRY and attempts to verify them.
"""
help
=
'Retries SoftwareSecurePhotoVerifications that are in a state of
\'
must_retry
\'
'
args
=
"<SoftwareSecurePhotoVerification id, SoftwareSecurePhotoVerification id, ...>"
help
=
(
"Retries SoftwareSecurePhotoVerifications passed as "
"arguments, or if no arguments are supplied, all that "
"are in a state of 'must_retry'"
)
def
handle
(
self
,
*
args
,
**
options
):
attempts_to_retry
=
SoftwareSecurePhotoVerification
.
objects
.
filter
(
status
=
'must_retry'
)
if
args
:
attempts_to_retry
=
SoftwareSecurePhotoVerification
.
objects
.
filter
(
receipt_id__in
=
args
)
force_must_retry
=
True
else
:
attempts_to_retry
=
SoftwareSecurePhotoVerification
.
objects
.
filter
(
status
=
'must_retry'
)
force_must_retry
=
False
print
(
"Attempting to retry {0} failed PhotoVerification submissions"
.
format
(
len
(
attempts_to_retry
)))
for
index
,
attempt
in
enumerate
(
attempts_to_retry
):
print
(
"Retrying submission #{0} (ID: {1}, User: {2})"
.
format
(
index
,
attempt
.
id
,
attempt
.
user
))
# Set the attempts status to 'must_retry' so that we can re-submit it
if
force_must_retry
:
attempt
.
status
=
'must_retry'
attempt
.
submit
(
copy_id_photo_from
=
attempt
.
copy_id_photo_from
)
print
(
"Retry result: {0}"
.
format
(
attempt
.
status
))
print
(
"Done resubmitting failed photo verifications"
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment