Фикса

This commit is contained in:
zakhy 2025-06-03 16:05:12 +07:00
parent 1637d0e8ce
commit 02fcd0cb48

View File

@ -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,
}