Kaydet (Commit) d0c49e7b authored tarafından Malcolm Tredinnick's avatar Malcolm Tredinnick

When retrieving a field by name, handle a missed case when the cache cannot be

initialised yet.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7478 bcc190cf-cafb-0310-a4f2-bffc1f526a37
üst 9c52d56f
......@@ -248,7 +248,7 @@ class Options(object):
return self._name_map[name]
except AttributeError:
cache = self.init_name_map()
return self._name_map[name]
return cache[name]
except KeyError:
raise FieldDoesNotExist('%s has no field named %r'
% (self.object_name, name))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment