mirror of https://github.com/django/django.git
Removed some unnecessary exception naming; thanks claudep.
This commit is contained in:
parent
ec9043ab2f
commit
c7a4ae94a0
|
@ -57,9 +57,9 @@ def find_management_module(app_name):
|
||||||
# of the app_name but the project directory itself isn't on the path.
|
# of the app_name but the project directory itself isn't on the path.
|
||||||
try:
|
try:
|
||||||
f, path, descr = imp.find_module(part, path)
|
f, path, descr = imp.find_module(part, path)
|
||||||
except ImportError as e:
|
except ImportError:
|
||||||
if os.path.basename(os.getcwd()) != part:
|
if os.path.basename(os.getcwd()) != part:
|
||||||
raise e
|
raise
|
||||||
else:
|
else:
|
||||||
if f:
|
if f:
|
||||||
f.close()
|
f.close()
|
||||||
|
|
|
@ -92,11 +92,11 @@ def Deserializer(object_list, **options):
|
||||||
# Look up the model and starting build a dict of data for it.
|
# Look up the model and starting build a dict of data for it.
|
||||||
try:
|
try:
|
||||||
Model = _get_model(d["model"])
|
Model = _get_model(d["model"])
|
||||||
except base.DeserializationError as e:
|
except base.DeserializationError:
|
||||||
if ignore:
|
if ignore:
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
raise e
|
raise
|
||||||
data = {}
|
data = {}
|
||||||
if 'pk' in d:
|
if 'pk' in d:
|
||||||
data[Model._meta.pk.attname] = Model._meta.pk.to_python(d.get("pk", None))
|
data[Model._meta.pk.attname] = Model._meta.pk.to_python(d.get("pk", None))
|
||||||
|
|
Loading…
Reference in New Issue