|
@@ -7,6 +7,7 @@ from adhesions.models import Adhesion, User, Corporation
|
|
|
|
|
|
class Profile(models.Model):
|
|
|
user = models.OneToOneField(User, related_name='profile', verbose_name='Utilisateur', on_delete=models.CASCADE)
|
|
|
+ common_name = models.CharField(max_length=32, blank=True, default='', verbose_name='Nom d’usage')
|
|
|
phone_number = models.CharField(max_length=16, blank=True, default='',
|
|
|
verbose_name='Numéro de téléphone')
|
|
|
address = models.TextField(blank=True, default='', verbose_name='Adresse')
|
|
@@ -25,4 +26,4 @@ class Profile(models.Model):
|
|
|
return Adhesion.objects.filter(models.Q(user__pk=self.user.pk) | models.Q(corporation__members__profile__pk=self.pk))
|
|
|
|
|
|
def __str__(self):
|
|
|
- return self.user.get_full_name() or self.user.username
|
|
|
+ return self.common_name or self.user.get_full_name() or self.user.username
|