Permalink
Browse files

add published and hidden attributes to schedules

  • Loading branch information...
1 parent a4d9459 commit c7592bc33e2626d84ec46fe1e7ba8e05c73ef74c @lukeman lukeman committed Jan 29, 2013
Showing with 5 additions and 1 deletion.
  1. +2 −0 symposion/schedule/models.py
  2. +3 −1 symposion/schedule/views.py
@@ -11,6 +11,8 @@
class Schedule(models.Model):
section = models.OneToOneField(Section)
+ published = models.BooleanField(default=True)
+ hidden = models.BooleanField("Hide schedule from overall conference view", default=False)
def __unicode__(self):
return "%s Schedule" % self.section
@@ -27,7 +27,7 @@ def fetch_schedule(slug):
def schedule_conference(request):
- schedules = Schedule.objects.all()
+ schedules = Schedule.objects.filter(published=True, hidden=False)
sections = []
for schedule in schedules:
@@ -47,6 +47,8 @@ def schedule_conference(request):
def schedule_detail(request, slug=None):
schedule = fetch_schedule(slug)
+ if not schedule.published and not request.user.is_staff:
+ raise Http404()
days_qs = Day.objects.filter(schedule=schedule)
days = [TimeTable(day) for day in days_qs]

0 comments on commit c7592bc

Please sign in to comment.