Commit 28d4e2e8 by Clinton Blackburn

Updated credit admin

ECOM-4379
parent f347e30b
......@@ -52,6 +52,8 @@ class CreditRequestAdmin(admin.ModelAdmin):
class CreditRequirementAdmin(admin.ModelAdmin):
""" Admin for CreditRequirement. """
list_display = ('course', 'namespace', 'name', 'display_name', 'active',)
list_filter = ('active', 'namespace',)
search_fields = ('course__course_key', 'namespace', 'name',)
class Meta(object):
model = CreditRequirement
......@@ -60,6 +62,7 @@ class CreditRequirementAdmin(admin.ModelAdmin):
class CreditRequirementStatusAdmin(admin.ModelAdmin):
""" Admin for CreditRequirementStatus. """
list_display = ('username', 'requirement', 'status',)
search_fields = ('username', 'requirement__course__course_key',)
class Meta(object):
model = CreditRequirementStatus
......
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('credit', '0002_creditconfig'),
]
operations = [
migrations.AlterModelOptions(
name='creditrequirementstatus',
options={'verbose_name_plural': 'Credit requirement statuses'},
),
]
......@@ -295,7 +295,7 @@ class CreditRequirement(TimeStampedModel):
ordering = ["order"]
def __unicode__(self):
return self.display_name
return '{course_id} - {name}'.format(course_id=self.course.course_key, name=self.display_name)
@classmethod
def add_or_update_course_requirement(cls, credit_course, requirement, order):
......@@ -430,6 +430,7 @@ class CreditRequirementStatus(TimeStampedModel):
class Meta(object):
unique_together = ('username', 'requirement')
verbose_name_plural = _('Credit requirement statuses')
@classmethod
def get_statuses(cls, requirements, username):
......
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