diff --git a/test_server/crm/views.py b/test_server/crm/views.py index 9e4b058..09173c2 100644 --- a/test_server/crm/views.py +++ b/test_server/crm/views.py @@ -687,7 +687,7 @@ def candidate(request): candidate.msg = get_msg_from_id(candidate.ID_number) candidate.exam_year = candidate.examtest_date.year candidate.exam_month = candidate.examtest_date.month - if candidate.workscope.name in ['放射工作人员(上岗)', '放射工作人员(在岗)']: + if candidate.workscope and candidate.workscope.name in ['放射工作人员(上岗)', '放射工作人员(在岗)']: candidate.date1 = candidate.train_start_date.strftime("%Y年%m月%d日") candidate.date2 = candidate.train_end_date.strftime("%Y年%m月%d日") candidate.date3 = candidate.issue_date.strftime("%Y年%m月%d日")