-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Track pull request NEW to merge release-1.25.0 to master (#681)
- Loading branch information
1 parent
4f7c723
commit d25511f
Showing
31 changed files
with
1,221 additions
and
772 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
backend/api/fixtures/operational/0028_update_model_year.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from django.db import transaction | ||
|
||
from api.management.data_script import OperationalDataScript | ||
from api.models.model_year import ModelYear | ||
|
||
|
||
class UpdateModelYear(OperationalDataScript): | ||
""" | ||
Add 2022-2023 model years | ||
""" | ||
is_revertable = False | ||
comment = 'Add 2022-2023 model years' | ||
|
||
def check_run_preconditions(self): | ||
return True | ||
|
||
@transaction.atomic | ||
def run(self): | ||
ModelYear.objects.update_or_create( | ||
name="2022", | ||
defaults={ | ||
'effective_date': "2022-01-01", | ||
'expiration_date': "2022-12-31" | ||
} | ||
) | ||
|
||
ModelYear.objects.update_or_create( | ||
name="2023", | ||
defaults={ | ||
'effective_date': "2023-01-01", | ||
'expiration_date': "2023-12-31" | ||
} | ||
) | ||
|
||
|
||
script_class = UpdateModelYear |
33 changes: 33 additions & 0 deletions
33
backend/api/fixtures/operational/0029_update_notifications.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
from django.db import transaction | ||
|
||
from api.management.data_script import OperationalDataScript | ||
from api.models.notification import Notification | ||
|
||
|
||
class UpdateNotifications(OperationalDataScript): | ||
""" | ||
Update notifications name | ||
""" | ||
is_revertable = False | ||
comment = 'Update notifications name' | ||
|
||
def check_run_preconditions(self): | ||
return True | ||
|
||
def update_notifications(self): | ||
notification = Notification.objects.get(notification_code="CREDIT_APPLICATION_ISSUED") | ||
notification.name = "Credit Application Processed by the Government of B.C" | ||
notification.save() | ||
notification = Notification.objects.get(notification_code="CREDIT_TRANSFER_RECORDED") | ||
notification.name = "Credit Transfer Recorded by the Government of B.C." | ||
notification.save() | ||
notification = Notification.objects.get(notification_code="CREDIT_TRANSFER_REJECTED") | ||
notification.name = "Credit Transfer Rejected by the Government of B.C." | ||
notification.save() | ||
|
||
@transaction.atomic | ||
def run(self): | ||
self.update_notifications() | ||
|
||
|
||
script_class = UpdateNotifications |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.