remove bare exceptions

This commit is contained in:
Laura Klünder 2017-10-25 00:47:40 +02:00
parent abfdd3df29
commit 6ed5188c07
3 changed files with 4 additions and 4 deletions

View file

@ -41,7 +41,7 @@ def changeset_detail(request, pk):
if changeset.can_edit(request):
try:
changed_object = changeset.changed_objects_set.get(pk=restore)
except:
except Exception:
pass
else:
try:

View file

@ -487,7 +487,7 @@ class BaseQueryWrapper(BaseWrapper):
# so… is this a multi-level-lookup?
try:
rel_model._meta.get_field(filter_type)
except:
except Exception:
raise NotImplementedError('Unsupported lookup or %s has no field "%s".' % (rel_model, filter_type))
# multi-level-lookup

View file

@ -52,12 +52,12 @@ class GeometryField(models.TextField):
return None
try:
geometry = shape(json.loads(value))
except:
except Exception:
raise ValidationError(_('Invalid GeoJSON.'))
self._validate_geomtype(geometry)
try:
geometry = clean_geometry(geometry)
except:
except Exception:
raise ValidationError(_('Could not clean geometry.'))
self._validate_geomtype(geometry)
return geometry