Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
  • Loading branch information...
commit d0c49e7b779b37569f564abb1675cb764ab65c04 1 parent 9c52d56
@malcolmt malcolmt authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  django/db/models/options.py
View
2  django/db/models/options.py
@@ -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))
Please sign in to comment.
Something went wrong with that request. Please try again.