add published and hidden attributes to schedules
This commit is contained in:
parent
a4d94594af
commit
c7592bc33e
2 changed files with 5 additions and 1 deletions
|
@ -11,6 +11,8 @@ from symposion.conference.models import Section
|
|||
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]
|
||||
|
|
Loading…
Reference in a new issue