fix cron auto update weather

This commit is contained in:
XuanHuyen
2025-03-22 11:26:32 +07:00
parent d08f3cb726
commit 03e9d62edb
2 changed files with 6 additions and 5 deletions
+3 -2
View File
@@ -34,5 +34,6 @@ class WeatherInformation(models.Model):
def fetch_weather(self):
"""Fetch weather data and update the record"""
weather_data = self.get_weather_information(self.city)
self.write(weather_data)
for record in self:
weather_data = self.get_weather_information(record.city)
record.write(weather_data)