Skip to content

Commit 5280ca7

Browse files
committed
Fixes for IFF automation
1 parent 5a2a5b9 commit 5280ca7

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

hypha/apply/funds/management/commands/create_iff_round.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,12 @@ def handle(self, *args, **options):
7676

7777
next_month_start, next_month_end = get_next_month_start_end()
7878

79-
print("DAYS")
80-
print(days_before_month_start)
81-
print((next_month_start - datetime.date.today()).days > days_before_month_start)
82-
8379
if (next_month_start - datetime.date.today()).days > days_before_month_start:
8480
self.stdout.write("Current date difference is not less than or equal to days_before_months_start, thus a new IFF round will not be created.")
8581
return
8682

87-
current_title = f"IFF-{datetime.date.today().year}-{datetime.date.today().month}"
88-
next_title = f"IFF-{next_month_start.year}-{next_month_start.month}"
83+
current_title = f"IFF-{datetime.date.today().year}-{datetime.date.today().month:02d}"
84+
next_title = f"IFF-{next_month_start.year}-{next_month_start.month:02d}"
8985

9086

9187
leads = []
@@ -121,11 +117,11 @@ def handle(self, *args, **options):
121117
next_round._copy_forms("review_forms")
122118
next_round._copy_forms("external_review_forms")
123119
next_round._copy_forms("determination_forms")
120+
next_round.workflow_name = fund.workflow_name
121+
next_round.save()
124122

125123
self.stdout.write(f"A new IFF round has been created with the title: \"{next_title}\"")
126124
except ValidationError: # If the round already exists, don't do anything else
127-
self.stdout.write(
128-
f"An IFF round already exists for this time and a new one will not be created!"
129-
)
125+
self.stdout.write("An IFF round already exists for this time, a new one will not be created!")
130126
else:
131127
self.stdout.write(f"No valid leads were found thus IFF round \"{next_title}\" will not be created")

0 commit comments

Comments
 (0)