def execute_locked(request, obj, message, call, *args, **kwargs):
 try:
  result = call(*args, **kwargs)
  if ((result is None) or result):
   messages.success(request, message)
 except FileLockException as error:
  messages.error(request, _('Failed to lock the repository, another operation in progress.'))
  report_error(error, sys.exc_info())
 return redirect_param(obj, '#repository')

def execute_locked ( request , obj , message , call , * args , ** kwargs ) : try : result = call ( * args , ** kwargs ) if ( ( result is None ) or result ) : messages . success ( request , message ) except FileLockException as error : messages . error ( request , _ ( 'Failed to lock the repository, another operation in progress.' ) ) report_error ( error , sys . exc_info ( ) ) return redirect_param ( obj , '#repository' )
helper function to catch possible lock exception .