From 7caa9d28a320c7e73dc7f29426da724b357a18b0 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 23 Jan 2014 16:42:50 +0530 Subject: [PATCH] installer get_hooks fix --- webnotes/core/doctype/todo/todo.py | 4 ++-- webnotes/hooks.txt | 5 ++++- webnotes/installer.py | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/webnotes/core/doctype/todo/todo.py b/webnotes/core/doctype/todo/todo.py index 6095e3c39a..1279fe6e9c 100644 --- a/webnotes/core/doctype/todo/todo.py +++ b/webnotes/core/doctype/todo/todo.py @@ -8,13 +8,13 @@ class DocType: def __init__(self, d, dl): self.doc, self.doclist = d, dl -# todo is viewable if either user or assigned_to or System Manager in roles +# todo is viewable if either owner or assigned_to or System Manager in roles def get_permission_query_conditions(): if "System Manager" in webnotes.get_roles(): return None else: - return """(tabToDo.owner = '{user}' or tabToDo.assigned_to = '{user}' or )""".format(user=webnotes.session.user) + return """(tabToDo.owner = '{user}' or tabToDo.assigned_to = '{user}')""".format(user=webnotes.session.user) def has_permission(doc): if "System Manager" in webnotes.get_roles(): diff --git a/webnotes/hooks.txt b/webnotes/hooks.txt index 6c9d3decbb..de96d2d02e 100644 --- a/webnotes/hooks.txt +++ b/webnotes/hooks.txt @@ -26,4 +26,7 @@ on_session_creation = webnotes.auth.notify_administrator_login # permissions permission_query_conditions:Event = webnotes.core.doctype.event.event.get_permission_query_conditions -has_permission:Event = webnotes.core.doctype.event.event.has_permission \ No newline at end of file +has_permission:Event = webnotes.core.doctype.event.event.has_permission + +permission_query_conditions:ToDo = webnotes.core.doctype.todo.todo.get_permission_query_conditions +has_permission:ToDo = webnotes.core.doctype.todo.todo.has_permission \ No newline at end of file diff --git a/webnotes/installer.py b/webnotes/installer.py index ca3adf5c95..0f6ca1c33f 100755 --- a/webnotes/installer.py +++ b/webnotes/installer.py @@ -87,7 +87,7 @@ def install_app(name, verbose=False): webnotes.flags.in_install_app = name webnotes.clear_cache() - app_hooks = webnotes.get_hooks(name) + app_hooks = webnotes.get_hooks(app_name=name) installed_apps = webnotes.get_installed_apps() if name in installed_apps: