def _document_lock_clear(document_id, user_name):
 try:
  redis = redis_client(name='default')
  key = _document_lock_key.format(id=document_id)
  locked_by = redis.get(key)
  if (locked_by == user_name):
   return redis.delete(key)
  else:
   return False
 except RedisError as e:
  statsd.incr('redis.errror')
  log.error(('Redis error: %s' % e))
  return False

def _document_lock_clear ( document_id , user_name ) : try : redis = redis_client ( name = 'default' ) key = _document_lock_key . format ( id = document_id ) locked_by = redis . get ( key ) if ( locked_by == user_name ) : return redis . delete ( key ) else : return False except RedisError as e : statsd . incr ( 'redis.errror' ) log . error ( ( 'Redis error: %s' % e ) ) return False
remove a lock from a document .