1
0

qml: in auth wrapper, use own logger and log func name

This commit is contained in:
Sander van Grieken
2023-04-05 14:11:32 +02:00
parent 8ea63f9bde
commit 88209617b4

View File

@@ -10,9 +10,10 @@ def auth_protect(func=None, reject=None, method='pin'):
@wraps(func)
def wrapper(self, *args, **kwargs):
self._logger.debug(str(self))
_logger = get_logger(__name__)
_logger.debug(f'{str(self)}.{func.__name__}')
if hasattr(self, '__auth_fcall'):
self._logger.debug('object already has a pending authed function call')
_logger.debug('object already has a pending authed function call')
raise Exception('object already has a pending authed function call')
setattr(self, '__auth_fcall', (func,args,kwargs,reject))
getattr(self, 'authRequired').emit(method)