fix: fixed the condition with getting currency from_currency

This commit is contained in:
Данил 2025-01-10 00:18:15 +03:00
parent db79e74268
commit ef980f1ef6

View file

@ -58,7 +58,7 @@ class Converter:
for key in ['terms', 'privacy', 'timestamp']: for key in ['terms', 'privacy', 'timestamp']:
data.pop(key, None) data.pop(key, None)
if len(data.get('to')) == 0: if not data.get('to'):
raise RuntimeError('Failed to get the exchange rate from DuckDuckGo') raise RuntimeError('Failed to get the exchange rate from DuckDuckGo')
conv = data.get('to')[0] conv = data.get('to')[0]