|
|
|
|
@ -123,7 +123,7 @@ class UserProfile(models.Model): |
|
|
|
|
verbose_name_plural = u'Реквизиты (профили)' |
|
|
|
|
|
|
|
|
|
def __unicode__(self): |
|
|
|
|
return u'%s, ИНН %s' % (self.get_company_name()[0:30], self.inn or u'не указан') |
|
|
|
|
return u'%s, ИНН %s' % (self.get_company_name()[0:30], self.inn or u'n/a') |
|
|
|
|
|
|
|
|
|
def save(self, *args, **kwargs): |
|
|
|
|
self.inn = only_numerics(self.inn) |
|
|
|
|
@ -195,9 +195,9 @@ class UserProfile(models.Model): |
|
|
|
|
def get_company_name(self): |
|
|
|
|
"""`ИП ФИО` или `Название Организации`.""" |
|
|
|
|
if self.profile_type == consts.IP_PROFILE: |
|
|
|
|
return u'ИП %s' % self.get_boss_full_fio() |
|
|
|
|
return u'ИП %s' % (self.get_boss_full_fio() or u'n/a',) |
|
|
|
|
elif self.profile_type == consts.ORG_PROFILE: |
|
|
|
|
return self.name.strip() |
|
|
|
|
return self.name.strip() or u'n/a' |
|
|
|
|
return u'' |
|
|
|
|
|
|
|
|
|
def get_inn_and_kpp(self): |
|
|
|
|
|