Skip to content

Commit

Permalink
Merge pull request #5333 from gitcoinco/fix-tip-test
Browse files Browse the repository at this point in the history
fix broken tip test
  • Loading branch information
octavioamu authored Oct 18, 2019
2 parents ff3cb70 + ec33305 commit 1e4ab6b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/economy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,15 @@ def convert_amount(from_amount, from_currency, to_currency, timestamp=None):
if to_currency in settings.STABLE_COINS:
to_currency = 'USDT'


if timestamp:
conversion_rate = ConversionRate.objects.filter(
from_currency=from_currency,
to_currency=to_currency,
timestamp__lte=timestamp
).order_by('-timestamp').first()
if not conversion_rate:
return convert_amount(from_amount, from_currency, to_currency)
else:
conversion_rate = ConversionRate.objects.filter(
from_currency=from_currency,
Expand Down

0 comments on commit 1e4ab6b

Please sign in to comment.