Revert "geoip: Tolerate lots of spaces in database fields"
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 28 Sep 2015 22:26:16 +0000 (00:26 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 28 Sep 2015 22:26:16 +0000 (00:26 +0200)
This reverts commit f28bd37a953eb51dd7a9e5ae6524f651b3f0757a.

webapp/backend/geoip.py

index 16159a5..9a3650f 100644 (file)
@@ -24,16 +24,7 @@ class GeoIP(Object):
                query = "SELECT * FROM geoip \
                        WHERE %s BETWEEN start_ip AND end_ip LIMIT 1"
 
-               ret = self.db.get(query, addr)
-
-               if ret:
-                       if ret.city:
-                               ret.city = ret.city.strip()
-
-                       if ret.postal_code:
-                               ret.postal_code = ret.postal_code.strip()
-
-               return ret
+               return self.db.get(query, addr)
 
        def get_asn(self, addr):
                query = "SELECT asn FROM geoip_asn \