* Add unsubscribe_token uuid field to CourseGoal model * Add endpoint to unsubcribe from just a token (no login needed) * Add admin page for the course_goals djangoapp * Add get_course_overview_or_404 utility method * Clean up URL handling in course_home_api AA-907
30 lines
808 B
Python
30 lines
808 B
Python
"""Django admin for course_goals"""
|
|
|
|
from django.contrib import admin
|
|
|
|
from lms.djangoapps.course_goals.models import CourseGoal, UserActivity
|
|
|
|
|
|
@admin.register(CourseGoal)
|
|
class CourseGoalAdmin(admin.ModelAdmin):
|
|
"""Admin for CourseGoal"""
|
|
list_display = ('id',
|
|
'user',
|
|
'course_key',
|
|
'days_per_week',
|
|
'subscribed_to_reminders')
|
|
raw_id_fields = ('user',)
|
|
search_fields = ('user__username', 'course_key')
|
|
|
|
|
|
@admin.register(UserActivity)
|
|
class UserActivityAdmin(admin.ModelAdmin):
|
|
"""Admin for UserActivity"""
|
|
|
|
list_display = ('id',
|
|
'user',
|
|
'course_key',
|
|
'date')
|
|
raw_id_fields = ('user',)
|
|
search_fields = ('user__username', 'course_key')
|