Skip to content

Commit

Permalink
chore: 692 - add migration + check for ncda_id (#707)
Browse files Browse the repository at this point in the history
  • Loading branch information
tim738745 authored May 23, 2024
1 parent bb8db41 commit e6b6859
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
5 changes: 3 additions & 2 deletions django/api/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,9 @@ def response_change(self, request, obj):
obj.save(update_fields=["status"])
rebate = GoElectricRebate.objects.filter(drivers_licence=dl).first()
if rebate:
ncda_id = rebate.ncda_id
rebate.redeemed = False
rebate.save(update_fields=["redeemed", "modified"])
update_rebate(ncda_id, {"Status": "Not-Redeemed"})
ncda_id = rebate.ncda_id
if ncda_id is not None:
update_rebate(ncda_id, {"Status": "Not-Redeemed"})
return ret
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Generated by Django 4.0.9 on 2024-05-23 06:45

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('api', '0018_alter_goelectricrebateapplication_status'),
]

operations = [
migrations.CreateModel(
name='ChangeRedeemedGoElectricRebateApplication',
fields=[
],
options={
'ordering': ['-modified'],
'proxy': True,
'indexes': [],
'constraints': [],
},
bases=('api.goelectricrebateapplication',),
),
]

0 comments on commit e6b6859

Please sign in to comment.