Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid 500 server error with IPv6 addresses (GeoIP)
I get 500 Server errors when searching for resources with a non-empty string. With DEBUG=True I can get the exception: "Invalid database type; expected IPv4 address" which is backtraced to the getcountry_code function in the stats/geoip.py file. The proposed try/except patch fixes the issue by returning the default empty string if geoip cannot find the country. As far as I know, this is used for statistic purposes, so providing the country guessed by the IP it is not crucial for metashare.
- Loading branch information