diff --git a/apps/note/tables.py b/apps/note/tables.py index 0048a0a5..505e8dfa 100644 --- a/apps/note/tables.py +++ b/apps/note/tables.py @@ -68,12 +68,8 @@ class HistoryTable(tables.Table): "note.change_transaction_invalidity_reason", record) else None, "onmouseover": lambda record: '$("#invalidity_reason_' + str(record.id) + '").show();$("#invalidity_reason_' - + str(record.id) + '").focus();' - if PermissionBackend.check_perm(get_current_authenticated_user(), - "note.change_transaction_invalidity_reason", record) else None, - "onmouseout": lambda record: '$("#invalidity_reason_' + str(record.id) + '").hide()' - if PermissionBackend.check_perm(get_current_authenticated_user(), - "note.change_transaction_invalidity_reason", record) else None, + + str(record.id) + '").focus();', + "onmouseout": lambda record: '$("#invalidity_reason_' + str(record.id) + '").hide()', } } ) @@ -101,15 +97,18 @@ class HistoryTable(tables.Table): """ When the validation status is hovered, an input field is displayed to let the user specify an invalidity reason """ + has_perm = PermissionBackend\ + .check_perm(get_current_authenticated_user(), "note.change_transaction_invalidity_reason", record) + val = "✔" if value else "✖" - if not PermissionBackend\ - .check_perm(get_current_authenticated_user(), "note.change_transaction_invalidity_reason", record): + + if value and not has_perm: return val val += "" return format_html(val)