]> git.ipfire.org Git - ipfire.org.git/blobdiff - src/backend/base.py
location: Use country name from location database
[ipfire.org.git] / src / backend / base.py
index c1d4cbb174d4b64300f2eea45250eda81b4cb5bf..00497a298cfa6ce8c3e2d3909ff7e366415f59ad 100644 (file)
@@ -177,6 +177,12 @@ class Backend(object):
        def location(self):
                return location.Database("/var/lib/location/database.db")
 
+       def get_country_name(self, country_code):
+               country = self.location.get_country(country_code)
+
+               if country:
+                       return country.name
+
        @lazy_property
        def ratelimiter(self):
                return ratelimit.RateLimiter(self)