Fix raid events mis-ordered due to not calling superclass's get_queryset() method.
This commit is contained in:
parent
3f8ed2c4ce
commit
f6c4c732d6
|
@ -19,6 +19,7 @@ User = get_user_model()
|
||||||
|
|
||||||
|
|
||||||
class RaidCalendar(MonthArchiveView):
|
class RaidCalendar(MonthArchiveView):
|
||||||
|
queryset = Raid.objects.all()
|
||||||
allow_empty = True
|
allow_empty = True
|
||||||
allow_future = True
|
allow_future = True
|
||||||
date_field = "date"
|
date_field = "date"
|
||||||
|
@ -27,11 +28,12 @@ class RaidCalendar(MonthArchiveView):
|
||||||
template_name_suffix = "_calendar"
|
template_name_suffix = "_calendar"
|
||||||
|
|
||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
if not self.request.user.is_authenticated:
|
queryset = super().get_queryset()
|
||||||
return Raid.objects.all()
|
if self.request.user.is_authenticated:
|
||||||
return Raid.objects.annotate(
|
queryset = queryset.annotate(
|
||||||
max_status=Max("responses__status", filter=Q(responses__character__user=self.request.user))
|
max_status=Max("responses__status", filter=Q(responses__character__user=self.request.user))
|
||||||
)
|
)
|
||||||
|
return queryset
|
||||||
|
|
||||||
def get_dated_queryset(self, **lookup):
|
def get_dated_queryset(self, **lookup):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in a new issue