From 02fcd0cb48cf1268cdaa91b32c485901d24320c1 Mon Sep 17 00:00:00 2001 From: zakhy <=> Date: Tue, 3 Jun 2025 16:05:12 +0700 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/seismicproc/views/views_main.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/seismicproc/views/views_main.py b/apps/seismicproc/views/views_main.py index af4d633..ed58a7e 100644 --- a/apps/seismicproc/views/views_main.py +++ b/apps/seismicproc/views/views_main.py @@ -158,13 +158,12 @@ def earthquake_list(request): time_filter = datetime.now() # Фильтрация землетрясений по дате - earthquakes = Earthquake.objects.filter(date_time__lte=time_filter).order_by( + earthquakes = Earthquake.objects.filter(date_time__gte=time_filter).order_by( "-date_time" ) res = [] for earthquake in earthquakes: - magn = earthquake.magnitude if earthquake.magnitude else 0.0 res.append( { "id": earthquake.id, @@ -173,7 +172,7 @@ def earthquake_list(request): "lat": earthquake.latitude, "lon": earthquake.longitude, "depth": earthquake.depth, - "magnitude": magn, + "magnitude": earthquake.magnitude, "region": earthquake.region, "source": earthquake.source, }