|
@@ -131,7 +131,6 @@ class Member(CoinLdapSyncMixin, AbstractUser):
|
|
|
Q(subscription_date__gt=date) |
|
|
|
Q(resign_date__lt=date))
|
|
|
|
|
|
-
|
|
|
def sync_to_ldap(self, creation, update_fields, *args, **kwargs):
|
|
|
"""
|
|
|
Update LDAP data when a member is saved
|
|
@@ -214,7 +213,6 @@ class Member(CoinLdapSyncMixin, AbstractUser):
|
|
|
body_template='members/emails/welcome_email.html',
|
|
|
context={'member': self})
|
|
|
|
|
|
-
|
|
|
class Meta:
|
|
|
verbose_name = 'membre'
|
|
|
|
|
@@ -231,6 +229,7 @@ Member._meta.get_field('last_name').null = False
|
|
|
def count_active_members():
|
|
|
return Member.objects.filter(status='member').count()
|
|
|
|
|
|
+
|
|
|
def get_automatic_username(first_name, last_name):
|
|
|
"""
|
|
|
Calcul le username automatiquement en fonction
|
|
@@ -261,7 +260,7 @@ def get_automatic_username(first_name, last_name):
|
|
|
|
|
|
while member:
|
|
|
if len(base_username) >= 30:
|
|
|
- username = base_username[30-len(str(incr)):]
|
|
|
+ username = base_username[30 - len(str(incr)):]
|
|
|
else:
|
|
|
username = base_username
|
|
|
username = username + str(incr)
|
|
@@ -270,6 +269,7 @@ def get_automatic_username(first_name, last_name):
|
|
|
|
|
|
return username
|
|
|
|
|
|
+
|
|
|
class CryptoKey(models.Model):
|
|
|
|
|
|
KEY_TYPE_CHOICES = (('RSA', 'RSA'), ('GPG', 'GPG'))
|
|
@@ -379,7 +379,7 @@ def define_username(sender, instance, **kwargs):
|
|
|
le calcul automatiquement en fonction du nom et du prénom
|
|
|
"""
|
|
|
if not instance.username and not instance.pk:
|
|
|
- instance.username = get_automatic_username(instance.first_name,
|
|
|
+ instance.username = get_automatic_username(instance.first_name,
|
|
|
instance.last_name)
|
|
|
|
|
|
|