Fixes: 1) Corrected `ForeignKey` type assertions across models; 2) Resolved typos and formatting inconsistencies in `.env` and README; 3) Fixed explicit boolean checks in user manager methods. Extra: Updated type hints in multiple models, serializers, and views.
15 lines
438 B
Python
15 lines
438 B
Python
from django.utils.translation import gettext_lazy as _
|
|
|
|
from payments.utils.cbr import get_rates as get_rates_cbr
|
|
|
|
|
|
def get_rates(provider: str):
|
|
if not provider:
|
|
raise ValueError(_("a provider to get rates from is required"))
|
|
|
|
# noinspection PyUnreachableCode
|
|
match provider:
|
|
case "cbr":
|
|
return get_rates_cbr()
|
|
case _:
|
|
raise ValueError(_(f"couldn't find provider {provider}"))
|