From dfbf23a3b27bbba1d9cb023aba7cf5c49f437373 Mon Sep 17 00:00:00 2001 From: Andrey Date: Thu, 29 Mar 2018 16:33:13 +0300 Subject: [PATCH] finance email --- access/models/other.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/access/models/other.py b/access/models/other.py index b7e4a1c..740ece6 100644 --- a/access/models/other.py +++ b/access/models/other.py @@ -54,8 +54,8 @@ class Account(models.Model): return self.owner.email def get_phone(self): - return '' if self.phone.national_number else \ - (self.phone.national_number if self.phone.country_code is None else str(self.phone)) + return '' if self.phone is None else ('' if self.phone.national_number else \ + (self.phone.national_number if self.phone.country_code is None else str(self.phone))) class Meta: verbose_name = 'Дополнительная информация о пользователе'