Skip to content

Commit f836ce4

Browse files
committed
Fix importing shifts from old servers
1 parent 890677d commit f836ce4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

uber/site_sections/staffing_admin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def _copy_department_templates(to_department, from_department):
6464

6565
def _copy_department_shifts(service, to_department, from_department, dept_role_map, dept_template_map):
6666
from_config = service.config.info()
67-
FROM_EPOCH = c.EVENT_TIMEZONE.localize(datetime.strptime(from_config['SHIFTS_EPOCH'], '%Y-%m-%d %H:%M:%S.%f'))
67+
FROM_EPOCH = c.EVENT_TIMEZONE.localize(datetime.strptime(from_config.get('SHIFTS_EPOCH', from_config['EPOCH']), '%Y-%m-%d %H:%M:%S.%f'))
6868
EPOCH_DELTA = c.SHIFTS_EPOCH - FROM_EPOCH
6969

7070
for from_job in from_department['jobs']:
@@ -80,7 +80,7 @@ def _copy_department_shifts(service, to_department, from_department, dept_role_m
8080
department_id=to_department.id)
8181
for from_required_role in from_job['required_roles']:
8282
to_job.required_roles.append(dept_role_map[from_required_role['id']])
83-
if from_job['job_template_id']:
83+
if from_job.get('job_template_id'):
8484
to_job.template = dept_template_map[from_job['job_template_id']]
8585
to_department.jobs.append(to_job)
8686

0 commit comments

Comments
 (0)