Skip to content

Commit 4dd0ec3

Browse files
committed
Track how many notifications have been sent about this invoice
1 parent 563f4fd commit 4dd0ec3

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

project/velkoja/holvichecker.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def process_overdue(self, send=False):
4141

4242
try:
4343
notified = NotificationSent.objects.get(transaction_unique_id=invoice.code)
44+
notified.notification_no += 1
4445
except NotificationSent.DoesNotExist:
4546
notified = NotificationSent()
4647
notified.transaction_unique_id = invoice.code
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# -*- coding: utf-8 -*-
2+
from __future__ import unicode_literals
3+
4+
from django.db import migrations, models
5+
6+
7+
class Migration(migrations.Migration):
8+
9+
dependencies = [
10+
('velkoja', '0001_initial'),
11+
]
12+
13+
operations = [
14+
migrations.AddField(
15+
model_name='notificationsent',
16+
name='notification_no',
17+
field=models.PositiveIntegerField(default=1),
18+
),
19+
]

project/velkoja/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ class NotificationSent(AsylumModel):
1313
stamp = models.DateTimeField(_("Datetime"), default=timezone.now, db_index=True)
1414
transaction_unique_id = models.CharField(_("Unique transaction id"), max_length=64, blank=False, unique=True)
1515
email = models.EmailField(_("Email address"), blank=False)
16+
notification_no = models.PositiveIntegerField(default=1)

0 commit comments

Comments
 (0)