Commit fc32032b by John Jarvis

Cleanup django-admin commands

parent d6403fe3
# -*- 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
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(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment