证书只显示月份

This commit is contained in:
caoqianming 2022-03-27 16:53:01 +08:00
parent 15f024bf1a
commit 7a5177f618
1 changed files with 8 additions and 8 deletions

View File

@ -682,14 +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)
candidate.exam_year = candidate.examtest_date.year
candidate.exam_month = candidate.examtest_date.month
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):