Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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
Malcolm Tredinnick authored April 27, 2008

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  django/db/models/options.py
2  django/db/models/options.py
@@ -248,7 +248,7 @@ def get_field_by_name(self, name):
248 248
                 return self._name_map[name]
249 249
             except AttributeError:
250 250
                 cache = self.init_name_map()
251  
-                return self._name_map[name]
  251
+                return cache[name]
252 252
         except KeyError:
253 253
             raise FieldDoesNotExist('%s has no field named %r'
254 254
                     % (self.object_name, name))

0 notes on commit d0c49e7

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