Merge "Fix setup_election_config for combined election events"
This commit is contained in:
commit
474001d298
@ -194,13 +194,11 @@ def main():
|
|||||||
end = end.replace(hour=23, minute=45)
|
end = end.replace(hour=23, minute=45)
|
||||||
events = []
|
events = []
|
||||||
for event in params['events']:
|
for event in params['events']:
|
||||||
|
e_types = [args.type]
|
||||||
if args.type == 'combined':
|
if args.type == 'combined':
|
||||||
|
e_types = ['PTL', 'TC']
|
||||||
if event == 'Campaigning':
|
if event == 'Campaigning':
|
||||||
name = 'TC %s' % event
|
e_types = ['TC']
|
||||||
else:
|
|
||||||
name = 'TC & PTL %s' % event
|
|
||||||
else:
|
|
||||||
name = '%s %s' % (args.type, event)
|
|
||||||
start = end - TWO_WEEK
|
start = end - TWO_WEEK
|
||||||
# For a TC or combined election we want the email deadline to match the
|
# For a TC or combined election we want the email deadline to match the
|
||||||
# beginning of the Campaigning period, which gives the officials time
|
# beginning of the Campaigning period, which gives the officials time
|
||||||
@ -218,10 +216,12 @@ def main():
|
|||||||
if event == 'Election':
|
if event == 'Election':
|
||||||
schedule = utils.get_schedule_data(names[idx+1])
|
schedule = utils.get_schedule_data(names[idx+1])
|
||||||
validate_tc_charter(args.type, schedule, start, end)
|
validate_tc_charter(args.type, schedule, start, end)
|
||||||
events.insert(0, OrderedDict(name=name,
|
for e_type in e_types:
|
||||||
start=iso_fmt(start),
|
name = '%s %s' % (e_type, event)
|
||||||
end=iso_fmt(end)))
|
events.insert(0, OrderedDict(name=name,
|
||||||
print('%s from %s to %s' % (name, iso_fmt(start), iso_fmt(end)))
|
start=iso_fmt(start),
|
||||||
|
end=iso_fmt(end)))
|
||||||
|
print('%s from %s to %s' % (name, iso_fmt(start), iso_fmt(end)))
|
||||||
end = start
|
end = start
|
||||||
|
|
||||||
print('Set email_deadline to %s' % (iso_fmt(email_deadline)))
|
print('Set email_deadline to %s' % (iso_fmt(email_deadline)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user