@@ -43,10 +43,6 @@ def on_approved(self, application, member):
43
43
msg = "on_approved called for %s" % application
44
44
logger .info (msg )
45
45
print (msg )
46
- mail = EmailMessage ()
47
- mail .to = [member .email , ]
48
- mail .body = """Your membership has been approved, your member id is #%d""" % member .member_id
49
- mail .send ()
50
46
51
47
# Auto-add the membership fee as recurring transaction
52
48
membership_fee = env .float ('MEMBEREXAMPLE_MEMBERSHIP_FEE' , default = None )
@@ -73,6 +69,11 @@ def on_approved(self, application, member):
73
69
mail .body = 'subscribe'
74
70
mail .send ()
75
71
72
+ mail = EmailMessage ()
73
+ mail .to = [member .email , ]
74
+ mail .body = """Your membership has been approved, your member id is #%d""" % member .member_id
75
+ mail .send ()
76
+
76
77
77
78
class TransactionHandler (BaseTransactionHandler ):
78
79
@@ -165,6 +166,10 @@ def import_generic_transaction(self, at, lt):
165
166
return lt
166
167
167
168
def import_tmatch_transaction (self , at , lt ):
169
+ if len (at .reference ) < 2 : # To avoid indexerrors
170
+ return None
171
+ if at .reference [0 :2 ] == "RF" : # ISO references, our lookup won't work with them, even worse: there will be exceptions
172
+ return None
168
173
# In this example the last meaningful number (last number is checksum) of the reference is used to recognize the TransactionTag
169
174
try :
170
175
lt .tag = TransactionTag .objects .get (tmatch = at .reference [- 2 ])
0 commit comments