fix cron auto update weather
This commit is contained in:
@@ -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)
|
||||
Reference in New Issue
Block a user