issue 120 order in dashboard
This commit is contained in:
parent
378401f8a9
commit
e32098aa63
|
@ -132,7 +132,7 @@ class DashboardView(AdminView, SingleTableView):
|
|||
Override the get_queryset method to filter events based on the user type.
|
||||
"""
|
||||
events_for_admins = self.get_admin_events()
|
||||
return Event.objects.filter(type__in=events_for_admins)
|
||||
return Event.objects.filter(type__in=events_for_admins).order_by("-created")
|
||||
|
||||
def get_admin_events(self):
|
||||
return [
|
||||
|
|
|
@ -65,7 +65,8 @@ class DashboardView(UserView, SingleTableView):
|
|||
def get_queryset(self, **kwargs):
|
||||
events_for_users = self.get_user_events()
|
||||
queryset = Event.objects.select_related('user').filter(
|
||||
user=self.request.user).filter(type__in=events_for_users)
|
||||
user=self.request.user).filter(
|
||||
type__in=events_for_users).order_by("-created")
|
||||
|
||||
return queryset
|
||||
|
||||
|
|
Loading…
Reference in New Issue