Browse Source

installer get_hooks fix

version-14
Rushabh Mehta 11 years ago
parent
commit
7caa9d28a3
3 changed files with 7 additions and 4 deletions
  1. +2
    -2
      webnotes/core/doctype/todo/todo.py
  2. +4
    -1
      webnotes/hooks.txt
  3. +1
    -1
      webnotes/installer.py

+ 2
- 2
webnotes/core/doctype/todo/todo.py View File

@@ -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():


+ 4
- 1
webnotes/hooks.txt View File

@@ -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
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

+ 1
- 1
webnotes/installer.py View File

@@ -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:


Loading…
Cancel
Save