Merge pull request #3908 from adityahase/fix-method-string

Convert method name to string instead of encoding
This commit is contained in:
Rushabh Mehta 2017-08-11 12:58:04 +05:30 committed by GitHub
commit 6726f7e1b0

View file

@ -662,7 +662,7 @@ class Document(BaseDocument):
# hack! to run hooks even if method does not exist
fn = lambda self, *args, **kwargs: None
fn.__name__ = method.encode("utf-8")
fn.__name__ = str(method)
out = Document.hook(fn)(self, *args, **kwargs)
self.run_email_alerts(method)