Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def get_base_queryset(self):
if self.request.user.has_perm("orga.view_speakers", self.request.event):
return SpeakerProfile.objects.filter(
event=self.request.event, user__isnull=False
)
if (
self.request.event.current_schedule
and self.request.event.settings.show_schedule
):
return SpeakerProfile.objects.filter(
user__submissions__slots__in=self.request.event.current_schedule.talks.all()
).distinct()
return SpeakerProfile.objects.none()
self.logged_actions(),
self.queued_mails.all(),
self.cfp,
self.mail_templates.all(),
self.information.all(),
TalkSlot.objects.filter(schedule__event=self),
Feedback.objects.filter(talk__event=self),
Resource.objects.filter(submission__event=self),
Answer.objects.filter(question__event=self),
AnswerOption.objects.filter(question__event=self),
Question.all_objects.filter(event=self),
Submission.all_objects.filter(event=self),
self.tracks.all(),
self.submission_types.all(),
self.schedules.all(),
SpeakerProfile.objects.filter(event=self),
self.rooms.all(),
ActivityLog.objects.filter(event=self),
self,
]
self._delete_mail_templates()
for entry in deletion_order:
entry.delete()
def get_object(self, queryset=None):
return SpeakerProfile.objects.filter(
event=self.request.event, user__code__iexact=self.kwargs["code"]
).first()
)
)
@staticmethod
def get_url(obj):
return obj.urls.ical
def get_content(self):
return self.get(self.request, self._exporting_event).content
def get_build_path(self, obj):
return self.get_file_build_path(obj)
class ExportSpeakerView(PretalxExportContextMixin, BuildableDetailView, SpeakerView):
queryset = SpeakerProfile.objects.filter(
user__submissions__slots__schedule__published__isnull=False
).select_related('user', 'event').prefetch_related('user__submissions').distinct()
def get_base_queryset(self):
if self.request.user.has_perm("orga.view_speakers", self.request.event):
return SpeakerProfile.objects.filter(
event=self.request.event, user__isnull=False
)
if (
self.request.event.current_schedule
and self.request.event.settings.show_schedule
):
return SpeakerProfile.objects.filter(
user__submissions__slots__in=self.request.event.current_schedule.talks.all()
).distinct()
return SpeakerProfile.objects.none()