Commit bd07b9f7 authored by Laury Bueno's avatar Laury Bueno
Browse files

[Certification] Add "DATA_INICIO" to certificate templates

parent 2a94dcd9
......@@ -194,6 +194,7 @@ class CourseCertificationDetailView(DetailView):
# {NUM_UNIDADES} : str(certificate.course_total_units))
# {HORAS} : str(certificate.course.course_load)
# {TURMA} : certificate.course_student.get_current_class().name)
# {DATA_INICIO} : certificate.course_student.start_date
if '{MODULO}' in context['cert_template'].text:
context['cert_template'].text = context['cert_template'].text.replace(
......@@ -207,12 +208,20 @@ class CourseCertificationDetailView(DetailView):
certificate.student.cpf,
)
# Prepare start date
start_date = '{0}/{1}/{2}'.format(
certificate.course_student.start_date.day,
certificate.course_student.start_date.month,
certificate.course_student.start_date.year
)
context['cert_template'].text = context['cert_template'].text\
.replace('{NOME}', certificate.student.get_full_name())\
.replace('{CONTRATO}', context['cert_template'].workspace.name)\
.replace('{NUM_UNIDADES}', str(certificate.course_total_units))\
.replace('{HORAS}', str(certificate.course.course_load))\
.replace('{TURMA}', certificate.course_student.get_current_class().name)\
.replace('{DATA_INICIO}', start_date)
url_name = resolve(self.request.path_info).url_name
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment