diff options
author | Raphaël Barrois <raphael.barrois@polytechnique.org> | 2014-01-22 00:23:57 +0100 |
---|---|---|
committer | Raphaël Barrois <raphael.barrois@polytechnique.org> | 2014-01-22 00:23:57 +0100 |
commit | e72d94b45312443d076d01ca833f19e8a5295847 (patch) | |
tree | 5e03ba2027ff61fafeb60d60c47b30355f07aa62 | |
parent | f907c405cf233b4ef14817952c11979125b4732c (diff) | |
download | factory-boy-e72d94b45312443d076d01ca833f19e8a5295847.tar factory-boy-e72d94b45312443d076d01ca833f19e8a5295847.tar.gz |
Fix mute_signals' decorator.
-rw-r--r-- | factory/django.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/factory/django.py b/factory/django.py index 6f39c34..a3dfdfc 100644 --- a/factory/django.py +++ b/factory/django.py @@ -263,8 +263,10 @@ class mute_signals(object): def __call__(self, callable_obj): if isinstance(callable_obj, base.FactoryMetaClass): - generate_method = getattr(callable_obj, '_generate') + # Retrieve __func__, the *actual* callable object. + generate_method = callable_obj._generate.__func__ + @classmethod @functools.wraps(generate_method) def wrapped_generate(*args, **kwargs): with self: |