-
-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Command to requeue form repeaters using app_id, form_name and submission time #35457
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple of suggestions.
""" | ||
Parses the input CSV data, stripping any extra spaces around values. | ||
""" | ||
reader = csv.reader(csv_data.strip().splitlines()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that fileinput in the standard library might be able to make this a little simpler.
import fileinput
.. and then instead of sys.stdin.read()
and ....splitlines()
you can use this:
reader = csv.reader(csv_data.strip().splitlines()) | |
with fileinput.input() as csv_data: | |
reader = csv.reader(csv_data) |
def process_requeue_forms(self, requeue_forms, soft_run=True): | ||
for extra, domain, app_id, form_name, form_xmlns, startdate, enddate, repeater_id in requeue_forms: | ||
startdate = datetime.datetime.strptime(startdate, "%d-%m-%Y").date() | ||
enddate = datetime.datetime.strptime(enddate, "%d-%m-%Y").date() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh boy, the Americans are going to be so confused. How about,
from datetime import date
... and then
enddate = datetime.datetime.strptime(enddate, "%d-%m-%Y").date() | |
enddate = date.fromisoformat(enddate) |
? That way startdate
and enddate
can be formatted using any valid ISO 8601 format, e.g. "2024-11-30" or "20241130".
|
||
|
||
class Command(BaseCommand): | ||
help = "Requeue forms by inputting appi_id, form_name and submission times" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo
help = "Requeue forms by inputting appi_id, form_name and submission times" | |
help = "Requeue forms by inputting app_id, form_name and submission times" |
Product Description
Adhoc command to facilitate requeuing form repeaters
Technical Summary
Feature Flag
NA
Safety Assurance
Tested locally, relies on existing requeue functions
Safety story
Automated test coverage
NA
QA Plan
Tested locally
Rollback instructions
Labels & Review