Commit fa2466f4 by asadazam93 Committed by AsadAzam

publish button to order seats

parent e4230fbc
...@@ -183,6 +183,11 @@ class ProgramTypeAdmin(admin.ModelAdmin): ...@@ -183,6 +183,11 @@ class ProgramTypeAdmin(admin.ModelAdmin):
list_display = ('name', 'slug',) list_display = ('name', 'slug',)
@admin.register(Seat)
class SeatAdmin(admin.ModelAdmin):
list_display = ('course_run', 'type')
@admin.register(SeatType) @admin.register(SeatType)
class SeatTypeAdmin(admin.ModelAdmin): class SeatTypeAdmin(admin.ModelAdmin):
list_display = ('name', 'slug',) list_display = ('name', 'slug',)
......
...@@ -165,7 +165,7 @@ class CourseRunViewSet(viewsets.GenericViewSet): ...@@ -165,7 +165,7 @@ class CourseRunViewSet(viewsets.GenericViewSet):
} }
) )
for seat in course_run.seats.exclude(type=Seat.CREDIT): for seat in course_run.seats.exclude(type=Seat.CREDIT).order_by('created'):
DiscoverySeat.objects.update_or_create( DiscoverySeat.objects.update_or_create(
course_run=discovery_course_run, course_run=discovery_course_run,
type=seat.type, type=seat.type,
......
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