Skip to content

Commit 9e14e15

Browse files
Consistent syntax
1 parent 4aebb08 commit 9e14e15

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

python/main.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ def route_webhook():
4747

4848
# Get the defaults for this payee based on previously imported data
4949
previous_transaction = ynab_client.findPreviousTransaction(payee_name)
50-
if not previous_transaction is None:
50+
if previous_transaction is not None:
5151
settings.log.debug('A previous transaction for the payee %s has been found' % payee_name)
5252
entities_payee_id = previous_transaction.entities_payee.id
5353
subcategory = previous_transaction.entities_subcategory
5454

5555
# Include the category used, as long as it's not a split category
56-
if not subcategory is None:
57-
if not subcategory.name == 'Split (Multiple Categories)...':
58-
settings.log.debug('We have identified the following category %s as a good default for this payee' % subcategory.name)
56+
if subcategory is not None:
57+
if subcategory.name != 'Split (Multiple Categories)...':
58+
settings.log.debug('We have identified the "%s" category as a good default for this payee' % subcategory.name)
5959
subcategory_id = subcategory.id
6060
else:
6161
settings.log.debug('Split category found, so we will not use that category for %s' % payee_name)
@@ -112,7 +112,7 @@ def route_webhook():
112112
source="Imported"
113113
)
114114

115-
if not subcategory_id is None:
115+
if subcategory_id is not None:
116116
transaction.entities_subcategory_id = subcategory_id
117117

118118
# If this transaction is in our local currency, then just automatically mark it as cleared.

0 commit comments

Comments
 (0)