瀏覽代碼

installer get_hooks fix

version-14
Rushabh Mehta 11 年之前
父節點
當前提交
7caa9d28a3
共有 3 個文件被更改,包括 7 次插入4 次删除
  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 查看文件

@@ -8,13 +8,13 @@ class DocType:
def __init__(self, d, dl): def __init__(self, d, dl):
self.doc, self.doclist = 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(): def get_permission_query_conditions():
if "System Manager" in webnotes.get_roles(): if "System Manager" in webnotes.get_roles():
return None return None
else: 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): def has_permission(doc):
if "System Manager" in webnotes.get_roles(): if "System Manager" in webnotes.get_roles():


+ 4
- 1
webnotes/hooks.txt 查看文件

@@ -26,4 +26,7 @@ on_session_creation = webnotes.auth.notify_administrator_login
# permissions # permissions


permission_query_conditions:Event = webnotes.core.doctype.event.event.get_permission_query_conditions 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 查看文件

@@ -87,7 +87,7 @@ def install_app(name, verbose=False):
webnotes.flags.in_install_app = name webnotes.flags.in_install_app = name
webnotes.clear_cache() webnotes.clear_cache()


app_hooks = webnotes.get_hooks(name)
app_hooks = webnotes.get_hooks(app_name=name)
installed_apps = webnotes.get_installed_apps() installed_apps = webnotes.get_installed_apps()


if name in installed_apps: if name in installed_apps:


Loading…
取消
儲存