mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-09-19 20:24:32 +02:00
Fix ruff
This commit is contained in:
@@ -2,11 +2,13 @@ import os
|
||||
import tempfile
|
||||
import urllib.parse
|
||||
from collections.abc import Generator
|
||||
from datetime import datetime
|
||||
from datetime import timezone
|
||||
from typing import Any
|
||||
from typing import Dict
|
||||
from typing import List
|
||||
from typing import Tuple
|
||||
from typing import Dict, Union
|
||||
from datetime import datetime, timezone
|
||||
from typing import Union
|
||||
|
||||
from zulip import Client
|
||||
|
||||
@@ -44,17 +46,17 @@ class ZulipConnector(LoadConnector, PollConnector):
|
||||
realm_url = realm_url.strip().lower()
|
||||
|
||||
# Remove any trailing slashes
|
||||
realm_url = realm_url.rstrip('/')
|
||||
realm_url = realm_url.rstrip("/")
|
||||
|
||||
# Ensure the URL has a scheme
|
||||
if not realm_url.startswith(('http://', 'https://')):
|
||||
realm_url = f'https://{realm_url}'
|
||||
if not realm_url.startswith(("http://", "https://")):
|
||||
realm_url = f"https://{realm_url}"
|
||||
|
||||
try:
|
||||
parsed = urllib.parse.urlparse(realm_url)
|
||||
|
||||
# Extract the base domain without any paths or ports
|
||||
netloc = parsed.netloc.split(':')[0] # Remove port if present
|
||||
netloc = parsed.netloc.split(":")[0] # Remove port if present
|
||||
|
||||
if not netloc:
|
||||
raise ValueError(
|
||||
|
Reference in New Issue
Block a user