示例#1
0
文件: schedule.py 项目: td00/pretalx
 def post(self, request, event):
     form = ScheduleReleaseForm(self.request.POST)
     form.is_valid()
     if self.request.event.schedules.filter(version=form.cleaned_data['version']).exists():
         messages.error(self.request, _('Please use a version number you did not use yet!'))
     else:
         self.request.event.release_schedule(form.cleaned_data['version'], user=request.user)
         messages.success(self.request, _('Nice, your schedule has been released!'))
     return redirect(self.request.event.orga_urls.schedule)
示例#2
0
文件: schedule.py 项目: td00/pretalx
 def get_context_data(self, event):
     ctx = super().get_context_data()
     version = self.request.GET.get('version')
     ctx['schedule_version'] = version
     ctx['active_schedule'] = self.request.event.schedules.filter(version=version).first() if version else self.request.event.wip_schedule
     ctx['release_form'] = ScheduleReleaseForm()
     return ctx
示例#3
0
 def get_context_data(self, event):
     ctx = super().get_context_data()
     ctx['schedule_version'] = self.request.GET.get('version')
     ctx['release_form'] = ScheduleReleaseForm()
     return ctx