diff options
| author | Matthew Schinckel <matt@schinckel.net> | 2016-04-18 11:25:15 +0930 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-04-19 10:17:29 -0400 |
| commit | 799e81ef6bc8cbb944dd3594a2646a594a04b44d (patch) | |
| tree | 77c09a788f5b1acea2cc5d2a84034f41d169a8ed /django | |
| parent | f5b8e9b2820177dae2bf392867641d097438f85e (diff) | |
[1.9.x] Fixed #26475 -- Added functools.partial() support to migrations autodetector.
Backport of 5402f3ab09413a571fd9d3aa27f6c76ec42ff891 from master
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/migrations/autodetector.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/django/db/migrations/autodetector.py b/django/db/migrations/autodetector.py index 62ea80be20..43ec67ee76 100644 --- a/django/db/migrations/autodetector.py +++ b/django/db/migrations/autodetector.py @@ -1,6 +1,7 @@ from __future__ import unicode_literals import datetime +import functools import re from itertools import chain @@ -63,6 +64,8 @@ class MigrationAutodetector(object): key: self.deep_deconstruct(value) for key, value in obj.items() } + elif isinstance(obj, functools.partial): + return (obj.func, self.deep_deconstruct(obj.args), self.deep_deconstruct(obj.keywords)) elif isinstance(obj, COMPILED_REGEX_TYPE): return RegexObject(obj) elif isinstance(obj, type): |
