Done. Three changes applied: tasks.py:
- Fix 3 — Renamed exchange_rate → rate throughout _get_exchange_rate() and the call site
- Fix 5 — Changed DB lookup and API fetch attempt logs to…
override_settings(CACHES=...) seems unnecessary since convert_prices() doesn't use caching. Could be removed if left from an earlier version.
Exchange rate lookups use logger.info() — consider logger.debug() for these routine operations.
_get_exchange_rate() returns a bare float (not an ExchangeRate object), but the variable name is misleading. Consider renaming to rate.
The raw SQL UPDATE in this migration could lock the table on large datasets. Consider chunked updates if the table grows significantly.
This signal handler fetches the old instance from the DB on every update. The old code in save() also fetched from DB, so it's a wash query-wise — not strictly fewer queries. Just worth noting the trade-off.