Skip to content

Commit 31e86d4

Browse files
committed
Don't show past news posting embargoes
The list of embargoes should only include current and future ones, not past. Fixes oversight in c9be097
1 parent 533eb49 commit 31e86d4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

pgweb/account/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from django.conf import settings
1414
from django.db import transaction, connection
1515
from django.db.models import Q, Prefetch
16+
from django.db.backends.postgresql.psycopg_any import DateTimeTZRange
1617

1718
import base64
1819
import urllib.parse
@@ -101,7 +102,7 @@ def home(request):
101102
'objects': lambda u: NewsArticle.objects.filter(org__managers=u),
102103
'tristate': True,
103104
'editapproved': False,
104-
'embargoes': lambda: NewsPostingEmbargo.objects.all(),
105+
'embargoes': lambda: NewsPostingEmbargo.objects.filter(duration__overlap=DateTimeTZRange(datetime.now(), None))
105106
},
106107
'events': {
107108
'title': 'event',

0 commit comments

Comments
 (0)