mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-05-06 13:01:50 +02:00
get_currencies can exclude no_currency
This commit is contained in:
parent
6095f29910
commit
e2159b52a6
1 changed files with 6 additions and 2 deletions
|
@ -25,8 +25,12 @@ class CurrencyConverter(object, metaclass=Singleton):
|
||||||
rates[self.no_currency] = 1.0
|
rates[self.no_currency] = 1.0
|
||||||
return rates
|
return rates
|
||||||
|
|
||||||
def get_currencies(self):
|
def get_currencies(self, with_no_currency=True):
|
||||||
rates = [rate for rate in self.get_rates()]
|
rates = [
|
||||||
|
rate
|
||||||
|
for rate in self.get_rates()
|
||||||
|
if with_no_currency or rate != self.no_currency
|
||||||
|
]
|
||||||
rates.sort(key=lambda rate: "" if rate == self.no_currency else rate)
|
rates.sort(key=lambda rate: "" if rate == self.no_currency else rate)
|
||||||
return rates
|
return rates
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue