Skip to content

Commit 5879afe

Browse files
committed
new: ignore transactions with type LEGACY_TRANSFER - those are hidden in the app
1 parent 758725a commit 5879afe

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
setuptools.setup(
44
name = 'WS-API',
55
packages = ['ws_api'],
6-
version = '0.9.0',
6+
version = '0.10.0',
77
license = 'GPL-3.0',
88
description = 'Access your Wealthsimple account using their (GraphQL) API.',
99
author = 'Guillaume Boudreau',

ws_api/wealthsimple_api.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,9 @@ def get_activities(self, account_id, how_many=50, order_by='OCCURRED_AT_DESC', i
345345

346346
# Filter function to ignore rejected/cancelled activities
347347
def filter_fn(activity):
348+
act_type = (activity.get('type', '') or '').upper()
348349
status = (activity.get('status', '') or '').lower()
349-
return status == '' or ('rejected' not in status and 'cancelled' not in status)
350+
return act_type != 'LEGACY_TRANSFER' and (not ignore_rejected or status == '' or ('rejected' not in status and 'cancelled' not in status))
350351

351352
activities = self.do_graphql_query(
352353
'FetchActivityFeedItems',
@@ -360,7 +361,7 @@ def filter_fn(activity):
360361
},
361362
'activityFeedItems.edges',
362363
'array',
363-
filter_fn = filter_fn if ignore_rejected else None,
364+
filter_fn = filter_fn,
364365
)
365366

366367
for act in activities:

0 commit comments

Comments
 (0)