|
6 | 6 |
|
7 | 7 | MAIN_NOMCOM_TEMPLATE_PATH = '/nomcom/defaults/' |
8 | 8 | QUESTIONNAIRE_TEMPLATE = 'position/questionnaire.txt' |
| 9 | +HEADER_QUESTIONNAIRE_TEMPLATE = 'position/header_questionnaire.txt' |
9 | 10 | REQUIREMENTS_TEMPLATE = 'position/requirements.txt' |
10 | 11 | HOME_TEMPLATE = 'home.rst' |
11 | 12 | INEXISTENT_PERSON_TEMPLATE = 'email/inexistent_person.txt' |
@@ -54,22 +55,32 @@ def initialize_templates_for_group(group): |
54 | 55 |
|
55 | 56 | def initialize_questionnaire_for_position(position): |
56 | 57 | questionnaire_path = MAIN_NOMCOM_TEMPLATE_PATH + QUESTIONNAIRE_TEMPLATE |
| 58 | + header_questionnaire_path = MAIN_NOMCOM_TEMPLATE_PATH + HEADER_QUESTIONNAIRE_TEMPLATE |
57 | 59 | template = DBTemplate.objects.get(path=questionnaire_path) |
58 | | - return DBTemplate.objects.create( |
59 | | - group=position.nomcom.group, |
60 | | - title=template.title + '[%s]' % position.name, |
61 | | - path='/nomcom/' + position.nomcom.group.acronym + '/' + str(position.id) + '/' + QUESTIONNAIRE_TEMPLATE, |
62 | | - variables=template.variables, |
63 | | - type_id=template.type_id, |
64 | | - content=template.content) |
| 60 | + header_template = DBTemplate.objects.get(path=header_questionnaire_path) |
| 61 | + DBTemplate.objects.create( |
| 62 | + group=position.nomcom.group, |
| 63 | + title=header_template.title + ' [%s]' % position.name, |
| 64 | + path='/nomcom/' + position.nomcom.group.acronym + '/' + str(position.id) + '/' + HEADER_QUESTIONNAIRE_TEMPLATE, |
| 65 | + variables=header_template.variables, |
| 66 | + type_id=header_template.type_id, |
| 67 | + content=header_template.content) |
| 68 | + questionnaire = DBTemplate.objects.create( |
| 69 | + group=position.nomcom.group, |
| 70 | + title=template.title + '[%s]' % position.name, |
| 71 | + path='/nomcom/' + position.nomcom.group.acronym + '/' + str(position.id) + '/' + QUESTIONNAIRE_TEMPLATE, |
| 72 | + variables=template.variables, |
| 73 | + type_id=template.type_id, |
| 74 | + content=template.content) |
| 75 | + return questionnaire |
65 | 76 |
|
66 | 77 |
|
67 | 78 | def initialize_requirements_for_position(position): |
68 | 79 | requirements_path = MAIN_NOMCOM_TEMPLATE_PATH + REQUIREMENTS_TEMPLATE |
69 | 80 | template = DBTemplate.objects.get(path=requirements_path) |
70 | 81 | return DBTemplate.objects.create( |
71 | 82 | group=position.nomcom.group, |
72 | | - title=template.title + '[%s]' % position.name, |
| 83 | + title=template.title + ' [%s]' % position.name, |
73 | 84 | path='/nomcom/' + position.nomcom.group.acronym + '/' + str(position.id) + '/' + REQUIREMENTS_TEMPLATE, |
74 | 85 | variables=template.variables, |
75 | 86 | type_id=template.type_id, |
|
0 commit comments