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
fc32032b
Commit
fc32032b
authored
Nov 09, 2012
by
John Jarvis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup django-admin commands
parent
d6403fe3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
lms/djangoapps/certificates/management/commands/find_unicode_certs.py
+5
-3
lms/djangoapps/certificates/management/commands/ungenerated_certs.py
+2
-1
No files found.
lms/djangoapps/certificates/management/commands/find_unicode_certs.py
View file @
fc32032b
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
from
django.core.management.base
import
BaseCommand
from
django.core.management.base
import
BaseCommand
from
certificates.models
import
GeneratedCertificate
from
certificates.models
import
certificate_status_for_student
from
certificates.queue
import
XQueueCertInterface
from
certificates.queue
import
XQueueCertInterface
from
django.contrib.auth.models
import
User
from
django.contrib.auth.models
import
User
from
student.models
import
UserProfile
from
student.models
import
UserProfile
import
sys
class
Command
(
BaseCommand
):
class
Command
(
BaseCommand
):
...
@@ -15,6 +15,9 @@ class Command(BaseCommand):
...
@@ -15,6 +15,9 @@ class Command(BaseCommand):
"""
"""
def
handle
(
self
,
*
args
,
**
options
):
def
handle
(
self
,
*
args
,
**
options
):
# TODO this is only temporary for CS169 certs
course_id
=
'BerkeleyX/CS169.1x/2012_Fall'
course_id
=
'BerkeleyX/CS169.1x/2012_Fall'
enrolled_students
=
User
.
objects
.
filter
(
enrolled_students
=
User
.
objects
.
filter
(
...
@@ -33,4 +36,3 @@ class Command(BaseCommand):
...
@@ -33,4 +36,3 @@ class Command(BaseCommand):
if
ret
==
'generating'
:
if
ret
==
'generating'
:
print
'generating for {0}'
.
format
(
student
)
print
'generating for {0}'
.
format
(
student
)
break
break
lms/djangoapps/certificates/management/commands/ungenerated_certs.py
View file @
fc32032b
from
django.core.management.base
import
BaseCommand
from
django.core.management.base
import
BaseCommand
from
certificates.models
import
GeneratedCertificate
from
certificates.models
import
certificate_status_for_student
from
certificates.models
import
certificate_status_for_student
from
certificates.queue
import
XQueueCertInterface
from
certificates.queue
import
XQueueCertInterface
from
django.contrib.auth.models
import
User
from
django.contrib.auth.models
import
User
...
@@ -16,6 +15,8 @@ class Command(BaseCommand):
...
@@ -16,6 +15,8 @@ class Command(BaseCommand):
def
handle
(
self
,
*
args
,
**
options
):
def
handle
(
self
,
*
args
,
**
options
):
# TODO This is only temporary for CS169 certs
course_id
=
'BerkeleyX/CS169.1x/2012_Fall'
course_id
=
'BerkeleyX/CS169.1x/2012_Fall'
enrolled_students
=
User
.
objects
.
filter
(
enrolled_students
=
User
.
objects
.
filter
(
courseenrollment__course_id
=
course_id
)
.
prefetch_related
(
courseenrollment__course_id
=
course_id
)
.
prefetch_related
(
...
...
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