Explorar el Código

installer get_hooks fix

version-14
Rushabh Mehta hace 11 años
padre
commit
7caa9d28a3
Se han modificado 3 ficheros con 7 adiciones y 4 borrados
  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 Ver fichero

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

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

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


Cargando…
Cancelar
Guardar