Renamed CorpContact.title to civility
This matches the same attributes for Student and Teacher models.
This commit is contained in:
parent
68e644b6f6
commit
764031a3ee
7 changed files with 37 additions and 25 deletions
|
|
@ -166,7 +166,7 @@ class CorpContactAdmin(admin.ModelAdmin):
|
|||
list_filter = (('archived', ArchivedListFilter),)
|
||||
ordering = ('last_name', 'first_name')
|
||||
search_fields = ('last_name', 'first_name', 'role')
|
||||
fields = (('title', 'last_name', 'first_name'),
|
||||
fields = (('civility', 'last_name', 'first_name'),
|
||||
('street', 'pcode', 'city'),
|
||||
('birth_date',),
|
||||
('corporation',),
|
||||
|
|
@ -192,7 +192,7 @@ class CorpContactAdmin(admin.ModelAdmin):
|
|||
|
||||
class ContactInline(admin.StackedInline):
|
||||
model = CorpContact
|
||||
fields = (('title', 'last_name', 'first_name'),
|
||||
fields = (('civility', 'last_name', 'first_name'),
|
||||
('sections', 'is_main', 'always_cc', 'archived'),
|
||||
('role', 'tel', 'email'))
|
||||
extra = 1
|
||||
|
|
|
|||
16
stages/migrations/0013_renamed_title_to_civility.py
Normal file
16
stages/migrations/0013_renamed_title_to_civility.py
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('stages', '0012_added_date_fields_for_student'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RenameField(
|
||||
model_name='corpcontact',
|
||||
old_name='title',
|
||||
new_name='civility',
|
||||
),
|
||||
]
|
||||
|
|
@ -83,10 +83,6 @@ class Teacher(models.Model):
|
|||
def __str__(self):
|
||||
return '{0} {1}'.format(self.last_name, self.first_name)
|
||||
|
||||
@property
|
||||
def title(self):
|
||||
return self.civility
|
||||
|
||||
@property
|
||||
def full_name(self):
|
||||
return '{0} {1}'.format(self.first_name, self.last_name)
|
||||
|
|
@ -390,7 +386,7 @@ class CorpContact(models.Model):
|
|||
ext_id = models.IntegerField(null=True, blank=True, verbose_name='ID externe')
|
||||
is_main = models.BooleanField(default=False, verbose_name='Contact principal')
|
||||
always_cc = models.BooleanField(default=False, verbose_name='Toujours en copie')
|
||||
title = models.CharField(max_length=40, blank=True, verbose_name='Civilité')
|
||||
civility = models.CharField(max_length=40, blank=True, verbose_name='Civilité')
|
||||
first_name = models.CharField(max_length=40, blank=True, verbose_name='Prénom')
|
||||
last_name = models.CharField(max_length=40, verbose_name='Nom')
|
||||
birth_date = models.DateField(blank=True, null=True, verbose_name='Date de naissance')
|
||||
|
|
@ -422,7 +418,7 @@ class CorpContact(models.Model):
|
|||
|
||||
@property
|
||||
def civility_full_name(self):
|
||||
return '{0} {1} {2}'.format(self.title, self.first_name, self.last_name)
|
||||
return '{0} {1} {2}'.format(self.civility, self.first_name, self.last_name)
|
||||
|
||||
@property
|
||||
def pcode_city(self):
|
||||
|
|
@ -430,7 +426,7 @@ class CorpContact(models.Model):
|
|||
|
||||
@property
|
||||
def adjective_ending(self):
|
||||
return 'e' if self.title == 'Madame' else ''
|
||||
return 'e' if self.civility == 'Madame' else ''
|
||||
|
||||
|
||||
class Domain(models.Model):
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ class EpcBaseDocTemplate(SimpleDocTemplate):
|
|||
|
||||
def add_address(self, person):
|
||||
self.story.append(Spacer(0, 2 * cm))
|
||||
self.story.append(Paragraph(person.title, style_adress))
|
||||
self.story.append(Paragraph(person.civility, style_adress))
|
||||
self.story.append(Paragraph(person.full_name, style_adress))
|
||||
try:
|
||||
self.story.append(Paragraph(person.street, style_adress))
|
||||
|
|
@ -436,7 +436,7 @@ class ExpertEdeLetterPdf(CompensationForm, EpcBaseDocTemplate):
|
|||
<br/><br/><br/>
|
||||
<strong>Travail de diplôme</strong>
|
||||
<br/><br/><br/>
|
||||
{expert_title},<br/><br/>
|
||||
{expert_civility},<br/><br/>
|
||||
Vous avez accepté de fonctionner comme expert{expert_accord} pour un travail de diplôme de l'un-e de nos
|
||||
étudiant-e-s. Nous vous remercions très chaleureusement de votre disponibilité.<br/><br/>
|
||||
En annexe, nous avons l'avantage de vous remettre le travail de {student_civility_full_name},
|
||||
|
|
@ -445,7 +445,7 @@ class ExpertEdeLetterPdf(CompensationForm, EpcBaseDocTemplate):
|
|||
"""
|
||||
self.story.append(Paragraph(ptext.format(
|
||||
current_date=django_format(date.today(), 'j F Y'),
|
||||
expert_title=self.student.expert.title,
|
||||
expert_civility=self.student.expert.civility,
|
||||
expert_accord=self.student.expert.adjective_ending,
|
||||
student_civility_full_name=self.student.civility_full_name,
|
||||
), style_normal))
|
||||
|
|
@ -463,7 +463,7 @@ class ExpertEdeLetterPdf(CompensationForm, EpcBaseDocTemplate):
|
|||
que vous voudrez bien compléter au niveau des «données privées / coordonnées de paiement» et nous retourner dans les meilleurs délais.
|
||||
<br/><br/>
|
||||
Restant à votre disposition pour tout complément d'information et en vous remerciant de
|
||||
l'attention que vous porterez à la présente, nous vous prions d'agréer, {expert_title}, l'asurance de notre considération distinguée.<br/>
|
||||
l'attention que vous porterez à la présente, nous vous prions d'agréer, {expert_civility}, l'asurance de notre considération distinguée.<br/>
|
||||
<br/><br/><br/>
|
||||
La responsable de filière:<br/>
|
||||
<br/><br/>
|
||||
|
|
@ -475,7 +475,7 @@ class ExpertEdeLetterPdf(CompensationForm, EpcBaseDocTemplate):
|
|||
internal_expert_civility=self.student.internal_expert.civility,
|
||||
internal_expert_full_name=self.student.internal_expert.full_name,
|
||||
internal_expert_role=self.student.internal_expert.role,
|
||||
expert_title=self.student.expert.title,
|
||||
expert_civility=self.student.expert.civility,
|
||||
resp_filiere=settings.RESP_FILIERE_EDE,
|
||||
), style_normal))
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ class StagesTest(TestCase):
|
|||
city="Moulineaux", pcode="2500",
|
||||
)
|
||||
contact = CorpContact.objects.create(
|
||||
corporation=corp, title="Monsieur", first_name="Jean", last_name="Horner",
|
||||
corporation=corp, civility="Monsieur", first_name="Jean", last_name="Horner",
|
||||
is_main=True, role="Responsable formation",
|
||||
)
|
||||
Student.objects.bulk_create([
|
||||
|
|
|
|||
|
|
@ -493,11 +493,11 @@ class HPContactsImportView(ImportViewBase):
|
|||
if contact is None:
|
||||
contact = CorpContact.objects.create(
|
||||
corporation=corp, first_name=line['PRENOMMDS'].strip(),
|
||||
last_name=line['NOMMDS'].strip(), title=line['CIVMDS'], email=line['EMAILMDS']
|
||||
last_name=line['NOMMDS'].strip(), civility=line['CIVMDS'], email=line['EMAILMDS']
|
||||
)
|
||||
else:
|
||||
if line['CIVMDS'] and contact.title != line['CIVMDS']:
|
||||
contact.title = line['CIVMDS']
|
||||
if line['CIVMDS'] and contact.civility != line['CIVMDS']:
|
||||
contact.civility = line['CIVMDS']
|
||||
contact.save()
|
||||
if line['EMAILMDS'] and contact.email != line['EMAILMDS']:
|
||||
contact.email = line['EMAILMDS']
|
||||
|
|
@ -696,7 +696,7 @@ class StudentConvocationExaminationView(EmailConfirmationView):
|
|||
])
|
||||
titles = [
|
||||
self.student.civility,
|
||||
self.student.expert.title,
|
||||
self.student.expert.civility,
|
||||
self.student.internal_expert.civility,
|
||||
]
|
||||
mme_count = titles.count('Madame')
|
||||
|
|
@ -762,7 +762,7 @@ EXPORT_FIELDS = [
|
|||
('Tél Inst', 'availability__corporation__tel'),
|
||||
('Domaine', 'availability__domain__name'),
|
||||
('Remarques Inst', 'availability__comment'),
|
||||
('Civilité contact', 'availability__contact__title'),
|
||||
('Civilité contact', 'availability__contact__civility'),
|
||||
('Prénom contact', 'availability__contact__first_name'),
|
||||
('Nom contact', 'availability__contact__last_name'),
|
||||
('ID externe contact', 'availability__contact__ext_id'),
|
||||
|
|
@ -783,7 +783,7 @@ NON_ATTR_EXPORT_FIELDS = [
|
|||
('Tél Inst', 'corporation__tel'),
|
||||
('Domaine', 'domain__name'),
|
||||
('Remarques Inst', 'comment'),
|
||||
('Civilité contact', 'contact__title'),
|
||||
('Civilité contact', 'contact__civility'),
|
||||
('Prénom contact', 'contact__first_name'),
|
||||
('Nom contact', 'contact__last_name'),
|
||||
('Tél contact', 'contact__tel'),
|
||||
|
|
@ -856,7 +856,7 @@ def stages_export(request, scope=None):
|
|||
contact = default_contacts.get(line[corp_name_field], {}).get(line[export_fields['Filière']])
|
||||
if contact:
|
||||
values = values[:-6] + [
|
||||
contact.title, contact.first_name, contact.last_name, contact.ext_id,
|
||||
contact.civility, contact.first_name, contact.last_name, contact.ext_id,
|
||||
contact.tel, contact.email
|
||||
]
|
||||
if always_ccs[line[corp_name_field]].get(line[export_fields['Filière']]):
|
||||
|
|
@ -984,7 +984,7 @@ GENERAL_EXPORT_FIELDS = [
|
|||
('Tel_Emp', 'corporation__tel'),
|
||||
|
||||
('Num_Form', 'instructor__ext_id'),
|
||||
('Titre_Form', 'instructor__title'),
|
||||
('Titre_Form', 'instructor__civility'),
|
||||
('Prenom_Form', 'instructor__first_name'),
|
||||
('Nom_Form', 'instructor__last_name'),
|
||||
('Tel_Form', 'instructor__tel'),
|
||||
|
|
@ -1042,7 +1042,7 @@ ORTRA_EXPORT_FIELDS = [
|
|||
('Ville_Emp', 'corporation__city'),
|
||||
('Tel_Emp', 'corporation__tel'),
|
||||
|
||||
('Titre_Form', 'instructor__title'),
|
||||
('Titre_Form', 'instructor__civility'),
|
||||
('Prenom_Form', 'instructor__first_name'),
|
||||
('Nom_Form', 'instructor__last_name'),
|
||||
('Tel_Form', 'instructor__tel'),
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ Nous vous informons que la soutenance du travail de diplôme de {{ student.civil
|
|||
- {{ date_examen }} en salle {{ salle }}
|
||||
|
||||
|
||||
Nous informons également {{ student.expert.title }} {{ student.expert.last_name }} que le mémoire lui est adressé ce jour par courrier postal.
|
||||
Nous informons également {{ student.expert.civility }} {{ student.expert.last_name }} que le mémoire lui est adressé ce jour par courrier postal.
|
||||
|
||||
|
||||
Nous vous remercions de nous confirmer par retour de courriel que vous avez bien reçu ce message et dans l’attente du plaisir de vous rencontrer prochainement, nous vous prions d’agréer, {{ global_civilities }}, nos salutations les meilleures.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue