Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
a6a58d0e
Commit
a6a58d0e
authored
12 years ago
by
Brian Wilson
Browse files
Options
Downloads
Patches
Plain Diff
pearson_dump: prettify, add missing error, provide default filename
parent
15a11e9c
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/djangoapps/student/management/commands/pearson_dump.py
+7
-5
7 additions, 5 deletions
...on/djangoapps/student/management/commands/pearson_dump.py
with
7 additions
and
5 deletions
common/djangoapps/student/management/commands/pearson_dump.py
+
7
−
5
View file @
a6a58d0e
from
optparse
import
make_option
from
json
import
dump
from
datetime
import
datetime
from
django.core.management.base
import
BaseCommand
,
CommandError
...
...
@@ -32,10 +33,9 @@ class Command(BaseCommand):
def
handle
(
self
,
*
args
,
**
options
):
if
len
(
args
)
<
1
:
raise
CommandError
(
"
Missing single argument: output JSON file
"
)
# get output location:
outputfile
=
args
[
0
]
outputfile
=
datetime
.
utcnow
().
strftime
(
"
pearson-dump-%Y%m%d-%H%M%S.json
"
)
else
:
outputfile
=
args
[
0
]
# construct the query object to dump:
registrations
=
TestCenterRegistration
.
objects
.
all
()
...
...
@@ -65,6 +65,8 @@ class Command(BaseCommand):
}
if
len
(
registration
.
upload_error_message
)
>
0
:
record
[
'
registration_error
'
]
=
registration
.
upload_error_message
if
len
(
registration
.
testcenter_user
.
upload_error_message
)
>
0
:
record
[
'
demographics_error
'
]
=
registration
.
testcenter_user
.
upload_error_message
if
registration
.
needs_uploading
:
record
[
'
needs_uploading
'
]
=
True
...
...
@@ -72,5 +74,5 @@ class Command(BaseCommand):
# dump output:
with
open
(
outputfile
,
'
w
'
)
as
outfile
:
dump
(
output
,
outfile
)
dump
(
output
,
outfile
,
indent
=
2
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment