Projet

Général

Profil

0001-mail-display-user-as-unknown-if-it-doesn-t-exist-any.patch

Frédéric Péters, 12 novembre 2016 21:10

Télécharger (1,14 ko)

Voir les différences:

Subject: [PATCH] mail: display user as unknown if it doesn't exist anymore
 (#13923)

 welco/sources/mail/models.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
welco/sources/mail/models.py
15 15
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
16 16

  
17 17
import re
18
import requests
18 19
import subprocess
19 20

  
20 21
from django.conf import settings
......
98 99
    def contact_name(self):
99 100
        if not self.contact_id:
100 101
            return ''
101
        user_details = get_wcs_data('api/users/%s/' % self.contact_id)
102
        try:
103
            user_details = get_wcs_data('api/users/%s/' % self.contact_id)
104
        except requests.HTTPError:
105
            return _('unknown')
102 106
        return user_details.get('user_display_name')
103 107

  
104 108
    def html_note(self):
105
-