mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-14 01:02:09 -05:00
Added a command to re-run the build_dvla_file for a given job id.
There was an instance where the file failed to create because the address in the personalisation had punctuation which caused the address lines to merge into one. Utils has been updated to fix that problem, this task will allow us to re-run the task so that the notifications can be sent.
This commit is contained in:
@@ -351,3 +351,14 @@ class PopulateAnnualBilling(Command):
|
||||
db.session.commit()
|
||||
|
||||
print("Populated annual billing {} for {} services".format(fy, services_result1.rowcount))
|
||||
|
||||
|
||||
class ReRunBuildDvlaFileForJob(Command):
|
||||
option_list = (
|
||||
Option('-j', '--job_id', dest='job_id', help="Enter the job id to rebuild the dvla file for"),
|
||||
)
|
||||
|
||||
def run(self, job_id):
|
||||
from app.celery.tasks import build_dvla_file
|
||||
from app.config import QueueNames
|
||||
build_dvla_file.apply_async([job_id], queue=QueueNames.JOBS)
|
||||
|
||||
@@ -23,8 +23,8 @@ manager.add_command('populate_service_sms_sender', commands.PopulateServiceSmsSe
|
||||
manager.add_command('populate_service_letter_contact', commands.PopulateServiceLetterContact)
|
||||
manager.add_command('populate_service_and_service_history_free_sms_fragment_limit',
|
||||
commands.PopulateServiceAndServiceHistoryFreeSmsFragmentLimit)
|
||||
manager.add_command('populate_annual_billing',
|
||||
commands.PopulateAnnualBilling)
|
||||
manager.add_command('populate_annual_billing', commands.PopulateAnnualBilling)
|
||||
manager.add_command('rerun_build_dvla_file', commands.ReRunBuildDvlaFileForJob)
|
||||
|
||||
|
||||
@manager.command
|
||||
|
||||
Reference in New Issue
Block a user