@@ -107,11 +107,9 @@ class Member(CoinLdapSyncMixin, AbstractUser):
# Renvoie la date de fin de la dernière cotisation du membre
def end_date_of_membership(self):
- try:
+ x = self.membership_fees.order_by('-end_date')
+ if x:
return self.membership_fees.order_by('-end_date')[0].end_date
- # TODO: bad practice de tout matcher comme ca
- except:
- return None
end_date_of_membership.short_description = "Date de fin d'adhésion"
def is_paid_up(self):
@@ -55,11 +55,6 @@ class IPPool(models.Model):
class IPSubnet(models.Model):
- # TODO: find some way to signal to Subscriptions objects when a subnet
- # gets modified (so that the subscription can update the LDAP backend
- # accordingly)
- # Actually, a better idea would be to build a custom relation and update
- # LDAP in the relation itself.
inet = CidrAddressField(blank=True, validators=[validate_subnet],
verbose_name="sous-réseau",
help_text="Laisser vide pour allouer automatiquement")
@@ -157,8 +157,7 @@ class VPNConfiguration(CoinLdapSyncMixin, Configuration):
class LdapVPNConfig(ldapdb.models.Model):
- # TODO: déplacer ligne suivante dans settings.py
+ base_dn = settings.VPN_CONF_BASE_DN
- base_dn = settings.VPN_CONF_BASE_DN # "ou=vpn,o=ILLYSE,l=Villeurbanne,st=RHA,c=FR"
object_classes = [b'person', b'organizationalPerson', b'inetOrgPerson',
b'top', b'radiusprofile']