@@ -378,31 +378,35 @@ def __init__(self, *args, **kwargs):
378
378
379
379
# if current date is <25th, give option to start membership from this month as well as next monht
380
380
today = datetime .today ()
381
+ if today .month == 12 :
382
+ next_month = 1
383
+ else :
384
+ next_month = today .month + 1
381
385
if today .day < 25 and not has_cancelled_current_membership :
382
386
# choice values refer to whether to backdate or not
383
- choices = ((1 , calendar .month_name [today .month ]), (0 , calendar .month_name [today . month + 1 ]))
387
+ choices = ((1 , calendar .month_name [today .month ]), (0 , calendar .month_name [next_month ]))
384
388
initial = None
385
389
help_text = (
386
390
f"Note that if you choose to start your membership in the current month ({ calendar .month_name [today .month ]} ), "
387
391
f"payment will be taken immediately, and you will have the entire { calendar .month_name [today .month ]} membership allowance to "
388
392
f"use until the end of the month. Payment will be taken again on the 25th { calendar .month_name [today .month ]} "
389
- f"for { calendar .month_name [today . month + 1 ]} 's membership, and on the 25th of each month thereafter."
393
+ f"for { calendar .month_name [next_month ]} 's membership, and on the 25th of each month thereafter."
390
394
)
391
395
else :
392
396
# no option to backdate if it's 25th or later in the month, only show option for next month
393
- choices = ((0 , calendar .month_name [today . month + 1 ]),)
397
+ choices = ((0 , calendar .month_name [next_month ]),)
394
398
initial = 0
395
399
if today .day >= 25 :
396
400
help_text = (
397
- f"Payment will be taken immediately for { calendar .month_name [today . month + 1 ]} 's membership. You will be able to use this membership "
398
- f"immediately to book for classes scheduled in { calendar .month_name [today . month + 1 ]} . Payment will be taken on the 25th of each "
401
+ f"Payment will be taken immediately for { calendar .month_name [next_month ]} 's membership. You will be able to use this membership "
402
+ f"immediately to book for classes scheduled in { calendar .month_name [next_month ]} . Payment will be taken on the 25th of each "
399
403
"month thereafter, for the following month's membership."
400
404
)
401
405
else :
402
406
help_text = (
403
- f"Payment will be taken on 25th { calendar .month_name [today .month ]} for { calendar .month_name [today . month + 1 ]} 's membership. "
407
+ f"Payment will be taken on 25th { calendar .month_name [today .month ]} for { calendar .month_name [next_month ]} 's membership. "
404
408
"You will be able to use this membership immediately to book for classes scheduled in "
405
- f"{ calendar .month_name [today . month + 1 ]} . Payment will be taken on the 25th of each "
409
+ f"{ calendar .month_name [next_month ]} . Payment will be taken on the 25th of each "
406
410
"month thereafter, for the following month's membership."
407
411
)
408
412
0 commit comments