]> git.ipfire.org Git - ipfire.org.git/commitdiff
accounts: Use c attribute to store the country
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 14 Dec 2023 11:47:35 +0000 (11:47 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 14 Dec 2023 11:53:52 +0000 (11:53 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/backend/accounts.py

index 1634e45f6b2f86fc999cc54bac312329a46e6fdd..9242f4b0e17676627bb23cbec26fc62a62903d4b 100644 (file)
@@ -648,7 +648,7 @@ class Accounts(Object):
                ret = {}
 
                for country in iso3166.countries:
-                       count = self._count("(&(objectClass=person)(st=%s))" % country.alpha2)
+                       count = self._count("(&(objectClass=person)(c=%s))" % country.alpha2)
 
                        if count:
                                ret[country] = count
@@ -1008,12 +1008,19 @@ class Account(LDAPObject):
 
        postal_code = property(get_postal_code, set_postal_code)
 
-       # XXX This should be c
-       def get_country_code(self):
+       def get_state(self):
                return self._get_string("st")
 
+       def set_state(self, state):
+               self._set_string("st", state)
+
+       state = property(get_state, set_state)
+
+       def get_country_code(self):
+               return self._get_string("c")
+
        def set_country_code(self, country_code):
-               self._set_string("st", country_code)
+               self._set_string("c", country_code)
 
        country_code = property(get_country_code, set_country_code)