Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions ifcbdb/dashboard/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1371,6 +1371,12 @@ def list_bins(request):
except (ValueError, TypeError):
return HttpResponseBadRequest("Invalid modified_since date")

not_modified_since = request.GET.get('not_modified_since')
try:
not_modified_since = pd.to_datetime(not_modified_since, utc=True)
except (ValueError, TypeError):
return HttpResponseBadRequest("Invalid not_modified_since date")

tags = request_get_tags(request.GET.get('tags'))
instrument_number = request_get_instrument(request.GET.get('instrument'))
cruise = request_get_cruise(request.GET.get('cruise'))
Expand Down Expand Up @@ -1404,6 +1410,9 @@ def list_bins(request):
if modified_since:
bin_qs = bin_qs.filter(modified__gt=modified_since)

if not_modified_since:
bin_qs = bin_qs.filter(modified__lt=not_modified_since)

bin_qs = bin_qs.order_by('sample_time')

bins = list(bin_qs.values('pid', 'sample_time')[:MAX_BINS])
Expand Down