Banktransfer: Save imported date into CharField, date format autodetection never works

This commit is contained in:
Raphael Michel
2016-09-08 22:24:31 +02:00
parent 54d5477069
commit 833c31022f
5 changed files with 36 additions and 14 deletions

View File

@@ -48,7 +48,7 @@ class BankTransaction(models.Model):
payer = models.TextField(blank=True)
reference = models.TextField(blank=True)
amount = models.DecimalField(max_digits=10, decimal_places=2)
date = models.DateField()
date = models.CharField(max_length=50)
order = models.ForeignKey('pretixbase.Order', null=True, blank=True)
def calculate_checksum(self):
@@ -57,7 +57,7 @@ class BankTransaction(models.Model):
hasher.update(clean.sub('', self.payer.lower()).encode('utf-8'))
hasher.update(clean.sub('', self.reference.lower()).encode('utf-8'))
hasher.update(clean.sub('', str(self.amount).lower()).encode('utf-8'))
hasher.update(clean.sub('', str(self.date).lower()).encode('utf-8'))
hasher.update(clean.sub('', self.date.lower()).encode('utf-8'))
return str(hasher.hexdigest())
def shred_private_data(self):