From: Michael Tremer Date: Thu, 14 Dec 2023 11:47:35 +0000 (+0000) Subject: accounts: Use c attribute to store the country X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ff1bdac922058f01201c466538b8249bcfa09f80;p=ipfire.org.git accounts: Use c attribute to store the country Signed-off-by: Michael Tremer --- diff --git a/src/backend/accounts.py b/src/backend/accounts.py index 1634e45f..9242f4b0 100644 --- a/src/backend/accounts.py +++ b/src/backend/accounts.py @@ -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)