Skip to content
Browse files

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

…cannot be

initialised yet.

git-svn-id: bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
1 parent 9c52d56 commit d0c49e7b779b37569f564abb1675cb764ab65c04 @malcolmt malcolmt committed
Showing with 1 addition and 1 deletion.
  1. +1 −1 django/db/models/
2 django/db/models/
@@ -248,7 +248,7 @@ def get_field_by_name(self, name):
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))

0 comments on commit d0c49e7

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