Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
cal_slug = self.kwargs['cal_slug']
self.calendar = get_object_or_404(Calendar, slug=cal_slug)
except:
self.calendar = None
return EventTime.upcoming_objects.all()
def get_context_data(self, **kwargs):
context = super(EventListView, self).get_context_data(**kwargs)
context['month'] = EventCalendar(self.get_queryset()).formatmonth(datetime.now().year, datetime.now().month)
if self.calendar:
context['calendar'] = self.calendar
return context
class EventDetailView(DateDetailView):
context_object_name = "event"
queryset=EventTime.upcoming_objects.all()
allow_future = True
date_field = 'start'
class EventYearView(YearArchiveView):
context_object_name = "event_list"
allow_future = True
date_field = 'start'
allow_empty = True
def get_queryset(self):
try:
if self.kwargs['cal_slug']:
return EventTime.upcoming_objects.filter(event__calendar__slug=self.kwargs['cal_slug'])
except:
pass
def get_queryset(self):
try:
if self.kwargs['cal_slug']:
return EventTime.upcoming_objects.filter(event__calendar__slug=self.kwargs['cal_slug'])
except:
pass
try:
if self.kwargs['slug']:
return EventTime.upcoming_objects.filter(event__slug=self.kwargs['slug'])
except:
return EventTime.upcoming_objects.all()