code: def block_username(username):
      
      if not username:
          # no reason to continue when there is no username
          return
      if config.DISABLE_USERNAME_LOCKOUT:
          # no need to block, we disabled it.
          return
      key = get_username_blocked_cache_key(username)
      if config.COOLOFF_TIME:
          REDIS_SERVER.set(key, 'blocked', config.COOLOFF_TIME)
      else:
          REDIS_SERVER.set(key, 'blocked')
      send_username_block_signal(username)
docs: given the username block it.