Instead of import InvalidId from the low level bson module,
first import it in our db.util wrapper and second import it
from pymongo.errors.
# Imports that other modules might use
from pymongo import DESCENDING
+from pymongo.errors import InvalidId
from mongokit import ObjectId
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-from bson.errors import InvalidId
from webob import exc
from mediagoblin.util import redirect
-from mediagoblin.db.util import ObjectId
+from mediagoblin.db.util import ObjectId, InvalidId
def _make_safe(decorator, original):