Skip to content
Browse files

Fixed #8904 -- Improved error message when spatial lookup is not avai…

…lable, and changed exception to `ValueError` to prevent swallowing of error on queryset evaluation.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 7e52657 commit 539cfe8cb73f777a24ac2f631a518a343be03a9a @jbronn jbronn committed
Showing with 2 additions and 1 deletion.
  1. +2 −1  django/contrib/gis/db/models/
3  django/contrib/gis/db/models/
@@ -241,7 +241,8 @@ def get_db_prep_lookup(self, lookup_type, value, connection, prepared=False):
return params
- raise TypeError("Field has invalid lookup: %s" % lookup_type)
+ raise ValueError('%s is not a valid spatial lookup for %s.' %
+ (lookup_type, self.__class__.__name__))
def get_prep_lookup(self, lookup_type, value):
if lookup_type == 'isnull':

0 comments on commit 539cfe8

Please sign in to comment.
Something went wrong with that request. Please try again.