diff options
| author | Chris Beaven <smileychris@gmail.com> | 2010-10-15 02:09:11 +0000 |
|---|---|---|
| committer | Chris Beaven <smileychris@gmail.com> | 2010-10-15 02:09:11 +0000 |
| commit | 65b98c9b41b3b1ba43df622e91fb561ceb16c70e (patch) | |
| tree | 68571e56faf950ac208082c68d9447f44ead7fb1 | |
| parent | dfcb814a877d9c5fdf67cc0ddc8d96b4f7c1d2db (diff) | |
Change the stacklevel for Field deprecation warnings to correctly point to the source of the problem
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14220 bcc190cf-cafb-0310-a4f2-bffc1f526a37
| -rw-r--r-- | django/db/models/fields/subclassing.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/django/db/models/fields/subclassing.py b/django/db/models/fields/subclassing.py index 3d04511dc2..148a998f1c 100644 --- a/django/db/models/fields/subclassing.py +++ b/django/db/models/fields/subclassing.py @@ -15,7 +15,7 @@ def call_with_connection(func): if not updated: warn("A Field class whose %s method hasn't been updated to take a " "`connection` argument." % func.__name__, - DeprecationWarning, stacklevel=2) + DeprecationWarning, stacklevel=3) def inner(*args, **kwargs): if 'connection' not in kwargs: @@ -23,7 +23,7 @@ def call_with_connection(func): kwargs['connection'] = connection warn("%s has been called without providing a connection argument. " % func.__name__, DeprecationWarning, - stacklevel=1) + stacklevel=2) if updated: return func(*args, **kwargs) if 'connection' in kwargs: @@ -40,7 +40,7 @@ def call_with_connection_and_prepared(func): if not updated: warn("A Field class whose %s method hasn't been updated to take " "`connection` and `prepared` arguments." % func.__name__, - DeprecationWarning, stacklevel=2) + DeprecationWarning, stacklevel=3) def inner(*args, **kwargs): if 'connection' not in kwargs: @@ -48,7 +48,7 @@ def call_with_connection_and_prepared(func): kwargs['connection'] = connection warn("%s has been called without providing a connection argument. " % func.__name__, DeprecationWarning, - stacklevel=1) + stacklevel=2) if updated: return func(*args, **kwargs) if 'connection' in kwargs: |
