From: Guillaume Pellerin Date: Mon, 14 Nov 2016 14:51:08 +0000 (+0100) Subject: Person email when activity and team only X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=44c259ebeb51e1e7f187e0efddb06f1dde4480c8;p=mezzo.git Person email when activity and team only --- diff --git a/app/organization/network/models.py b/app/organization/network/models.py index cb51d4c2..b81c4170 100644 --- a/app/organization/network/models.py +++ b/app/organization/network/models.py @@ -445,7 +445,7 @@ class PersonActivity(Period): class Meta: verbose_name = _('activity') verbose_name_plural = _('activities') - ordering = ['person__last_name',] + ordering = ['-date_from',] def __str__(self): if self.status: diff --git a/app/templates/network/person_detail.html b/app/templates/network/person_detail.html index 2623982a..b047ec99 100644 --- a/app/templates/network/person_detail.html +++ b/app/templates/network/person_detail.html @@ -31,7 +31,7 @@ {{ person.bio|richtext_filters|safe }} {% endeditable %} - {% if not person.email and person.activities.all and person.teams %}

{% trans 'Email' %} : {{ person_email }}

{% elif person.email %}

{% trans 'Email' %} : {{ person.email|unspam }}

{% endif %} + {% if not person.email and person.activities.all and person.activities.all.0.teams.all %}

{% trans 'Email' %} : {{ person_email }}

{% elif person.email %}

{% trans 'Email' %} : {{ person.email|unspam }}

{% endif %} {% with person.activities.all as activities %} {% if activities %}