diff --git a/test_server/crm/templates/index.html b/test_server/crm/templates/index.html index 6a1b758..0eaecaf 100644 --- a/test_server/crm/templates/index.html +++ b/test_server/crm/templates/index.html @@ -140,7 +140,7 @@ class="inner-cell" data-tag="idtype">身份证:{{candidate.ID_number}},于 - {{candidate.examtest_date|date}}参加  + {{candidate.exam_year}}年{{candidate.exam_month}}月参加  {{candidate.workscope_name}} 辐射安全与防护考核,成绩合格。 diff --git a/test_server/crm/views.py b/test_server/crm/views.py index da3da27..cdfa056 100644 --- a/test_server/crm/views.py +++ b/test_server/crm/views.py @@ -682,12 +682,14 @@ from django.shortcuts import render from django.http import Http404 def candidate(request): if request.GET.get('id', None): - try: - candidate = Candidate.objects.get(id=request.GET.get('id'), number__isnull=False) - candidate.msg = get_msg_from_id(candidate.ID_number) - return render(request, 'index.html', {"candidate":candidate}) - except: - raise Http404 + # try: + candidate = Candidate.objects.get(id=request.GET.get('id'), number__isnull=False) + candidate.msg = get_msg_from_id(candidate.ID_number) + candidate.exam_year = candidate.examtest_date.year + candidate.exam_month = candidate.examtest_date.month + return render(request, 'index.html', {"candidate":candidate}) + # except: + # raise Http404 raise Http404 def get_msg_from_id(id_number):