mirror of
https://github.com/ae-utbm/sith.git
synced 2024-11-22 14:13:21 +00:00
core: fix notif ordering
Signed-off-by: Skia <skia@libskia.so>
This commit is contained in:
parent
4c1b231ec9
commit
dd5926b404
@ -78,7 +78,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<a href="#" onclick="display_notif()">🔔 ({{ user.notifications.filter(viewed=False).count() }})</a>
|
<a href="#" onclick="display_notif()">🔔 ({{ user.notifications.filter(viewed=False).count() }})</a>
|
||||||
<ul id="header_notif">
|
<ul id="header_notif">
|
||||||
{% for n in user.notifications.filter(viewed=False).order_by('-id') %}
|
{% for n in user.notifications.filter(viewed=False).order_by('-date') %}
|
||||||
<li>
|
<li>
|
||||||
<a href="{{ url("core:notification", notif_id=n.id) }}">
|
<a href="{{ url("core:notification", notif_id=n.id) }}">
|
||||||
<span class="header_notif_date">
|
<span class="header_notif_date">
|
||||||
|
@ -51,7 +51,7 @@ class NotificationList(ListView):
|
|||||||
def get_queryset(self):
|
def get_queryset(self):
|
||||||
if 'see_all' in self.request.GET.keys():
|
if 'see_all' in self.request.GET.keys():
|
||||||
self.request.user.notifications.update(viewed=True)
|
self.request.user.notifications.update(viewed=True)
|
||||||
return self.request.user.notifications.order_by('-id')[:20]
|
return self.request.user.notifications.order_by('-date')[:20]
|
||||||
|
|
||||||
|
|
||||||
def notification(request, notif_id):
|
def notification(request, notif_id):
|
||||||
|
Loading…
Reference in New Issue
Block a user