Skip to content

Commit 77bed98

Browse files
authored
Merge pull request #59 from holohup/codex/fix-realexchange-validation-error
Patch RealExchange handling
2 parents 81a4624 + 1852d30 commit 77bed98

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

trademan/base/management/commands/update.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
from tinkoff.invest.retrying.settings import RetryClientSettings
1010
from tinkoff.invest.retrying.sync.client import RetryingClient
1111
from tinkoff.invest.schemas import Future, RealExchange, Share
12+
13+
# Support newer enum values when running with an older Tinkoff SDK
14+
try: # pragma: no cover - defensive patch
15+
RealExchange(4)
16+
except ValueError:
17+
RealExchange._value2member_map_[4] = RealExchange(0)
1218
from tinkoff.invest.utils import quotation_to_decimal
1319

1420

0 commit comments

Comments
 (0)