I am developing a GeoDjango application where users can upload map files and do some basic mapping operations like querying features inside polygons. 

I recognized that users happen to upload "MultiLineString"s instead of "Polygon"s sometimes. This causes the queries expecting closed geometries to fail. 

What is the best way to convert a MultiLineString object to a Polygon in Python?