Поправил геофильтр и отображения источника в отметках
This commit is contained in:
@@ -209,7 +209,10 @@ class SourceObjItemsAPIView(LoginRequiredMixin, View):
|
||||
if geo_date_from:
|
||||
try:
|
||||
geo_date_from_obj = datetime.strptime(geo_date_from, "%Y-%m-%d")
|
||||
objitems = objitems.filter(geo_obj__timestamp__gte=geo_date_from_obj)
|
||||
objitems = objitems.filter(
|
||||
geo_obj__isnull=False,
|
||||
geo_obj__timestamp__gte=geo_date_from_obj
|
||||
)
|
||||
except (ValueError, TypeError):
|
||||
pass
|
||||
|
||||
@@ -218,7 +221,10 @@ class SourceObjItemsAPIView(LoginRequiredMixin, View):
|
||||
geo_date_to_obj = datetime.strptime(geo_date_to, "%Y-%m-%d")
|
||||
# Add one day to include entire end date
|
||||
geo_date_to_obj = geo_date_to_obj + timedelta(days=1)
|
||||
objitems = objitems.filter(geo_obj__timestamp__lt=geo_date_to_obj)
|
||||
objitems = objitems.filter(
|
||||
geo_obj__isnull=False,
|
||||
geo_obj__timestamp__lt=geo_date_to_obj
|
||||
)
|
||||
except (ValueError, TypeError):
|
||||
pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user