Parcourir la source

Fix vpn model use username instead of ldap_cn

Fabs il y a 10 ans
Parent
commit
c4dc5a66c8
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      coin/vpn/models.py

+ 2 - 2
coin/vpn/models.py

@@ -117,8 +117,8 @@ class VPNConfiguration(CoinLdapSyncMixin, Configuration):
         # login should not contain any ".", because graphite uses "." as a
         # login should not contain any ".", because graphite uses "." as a
         # separator.
         # separator.
         if not self.login:
         if not self.login:
-            username = self.offersubscription.member.ldap_cn
-            vpns = VPNConfiguration.objects.filter(offersubscription__member__ldap_cn=username)
+            username = self.offersubscription.member.username
+            vpns = VPNConfiguration.objects.filter(offersubscription__member__username=username)
             # This is the list of existing VPN logins for this user.
             # This is the list of existing VPN logins for this user.
             logins = [vpn.login for vpn in vpns]
             logins = [vpn.login for vpn in vpns]
             # 100 VPNs ought to be enough for anybody.
             # 100 VPNs ought to be enough for anybody.