mirror of
https://github.com/pretix/pretix.git
synced 2026-08-05 09:57:49 +00:00
Ignore spaces in bank transfer references
This commit is contained in:
@@ -142,7 +142,7 @@ def process_banktransfers(self, job: int, data: list) -> None:
|
||||
pattern = re.compile("(%s)[ \-_]*([A-Z0-9]{%s})" % ("|".join(prefixes), code_len))
|
||||
|
||||
for trans in transactions:
|
||||
match = pattern.search(trans.reference.upper())
|
||||
match = pattern.search(trans.reference.replace(" ", "").upper())
|
||||
|
||||
if match:
|
||||
if job.event:
|
||||
|
||||
@@ -143,6 +143,18 @@ def test_autocorrection(env, job):
|
||||
assert env[2].status == Order.STATUS_PAID
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_random_spaces(env, job):
|
||||
process_banktransfers(job, [{
|
||||
'payer': 'Karla Kundin',
|
||||
'reference': 'Bestellung DUM MY123 45NEXTLINE',
|
||||
'amount': '23.00',
|
||||
'date': '2016-01-26',
|
||||
}])
|
||||
env[2].refresh_from_db()
|
||||
assert env[2].status == Order.STATUS_PAID
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_huge_amount(env, job):
|
||||
env[2].total = Decimal('23000.00')
|
||||
|
||||
Reference in New Issue
Block a user