证书只显示月份
This commit is contained in:
parent
15f024bf1a
commit
7a5177f618
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue