Use tb[-1]
instead of tb[len(tb) - 1]
to get the last element
Hardcoded temporary directory
hasattr
is used to check if the object is callable
Special method __add__
should return NotImplemented
@@ -18,13 +18,9 @@ def tar_something():
|
|
18
18
|
if (
|
19
19
|
order.status == STATUS_OK
|
20
|
-
and (
|
21
|
-
isinstance(order.type, Wallet)
|
22
|
-
|
20
|
+
and isinstance(order.type, (Wallet, Credit, COD))
|
23
|
-
or isinstance(order.type, COD)
|
24
|
-
)
|
25
21
|
and product.stock > 0
|
26
|
-
and
|
22
|
+
and isinstance(product.price, (float, int))
|
27
23
|
):
|
28
24
|
make_transaction(order, product, merchant)
|
29
25
|
alert_merchant(order, product)
|