Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions backend/btrixcloud/crawlconfigs.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,6 @@ async def make_inactive_or_delete(
status = "deleted"

else:

if not await self.crawl_configs.find_one_and_update(
{"_id": crawlconfig.id, "inactive": {"$ne": True}},
{"$set": query},
Expand Down Expand Up @@ -656,7 +655,6 @@ async def run_now(

@router.delete("/{cid}")
async def make_inactive(cid: str, org: Organization = Depends(org_crawl_dep)):

crawlconfig = await ops.get_crawl_config(uuid.UUID(cid), org)

if not crawlconfig:
Expand Down
3 changes: 0 additions & 3 deletions backend/btrixcloud/crawls.py
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,6 @@ async def list_single_crawl(crawl_id, org: Organization = Depends(org_viewer_dep
async def scale_crawl(
scale: CrawlScale, crawl_id, org: Organization = Depends(org_crawl_dep)
):

result = await crawl_manager.scale_crawl(crawl_id, org.id_str, scale.scale)
if not result or not result.get("success"):
raise HTTPException(
Expand Down Expand Up @@ -740,7 +739,6 @@ async def add_exclusion(
org: Organization = Depends(org_crawl_dep),
user: User = Depends(user_dep),
):

return await ops.add_exclusion(crawl_id, regex, org, user)

@app.delete(
Expand All @@ -753,7 +751,6 @@ async def remove_exclusion(
org: Organization = Depends(org_crawl_dep),
user: User = Depends(user_dep),
):

return await ops.remove_exclusion(crawl_id, regex, org, user)

return ops
Expand Down
1 change: 1 addition & 0 deletions backend/btrixcloud/emailsender.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from email.message import EmailMessage


# pylint: disable=too-few-public-methods
class EmailSender:
"""SMTP Email Sender"""
Expand Down
2 changes: 1 addition & 1 deletion backend/btrixcloud/k8s/crawl_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class K8SCrawlJob(K8SJobMixin, CrawlJob):
async def _do_scale(self, new_scale):
crawl = await self._get_crawl()
if not crawl:
raise Exception("crawl_not_found")
raise RuntimeError("crawl_not_found")

# if making scale smaller, ensure existing crawlers saved their data
pods = []
Expand Down
1 change: 1 addition & 0 deletions backend/btrixcloud/k8s/k8sapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from kubernetes_asyncio.stream import WsApiClient
from kubernetes_asyncio.client.api_client import ApiClient


# pylint: disable=too-few-public-methods
class K8sAPI:
"""K8S API accessors"""
Expand Down
3 changes: 2 additions & 1 deletion backend/btrixcloud/k8s/k8sman.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,9 @@ async def _get_storage_secret(self, storage_name):
f"storage-{storage_name}",
namespace=self.namespace,
)
# pylint: disable=broad-except
except Exception:
# pylint: disable=broad-except,raise-missing-from
# pylint: disable=broad-exception-raised,raise-missing-from
raise Exception(f"Storage {storage_name} not found")

return None
Expand Down
3 changes: 1 addition & 2 deletions backend/btrixcloud/orgs.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ async def get_org_owners(self, org: Organization):


# ============================================================================
# pylint: disable=too-many-statements
def init_orgs_api(app, mdb, user_manager, invites, user_dep: User):
"""Init organizations api router for /orgs"""
# pylint: disable=too-many-locals
Expand Down Expand Up @@ -422,7 +423,6 @@ async def set_role(
org: Organization = Depends(org_owner_dep),
user: User = Depends(user_dep),
):

other_user = await user_manager.user_db.get_by_email(update.email)
if not other_user:
raise HTTPException(
Expand All @@ -443,7 +443,6 @@ async def invite_user_to_org(
org: Organization = Depends(org_owner_dep),
user: User = Depends(user_dep),
):

if await invites.invite_user(
invite,
user,
Expand Down
1 change: 1 addition & 0 deletions backend/btrixcloud/profiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

BROWSER_EXPIRE = 300


# ============================================================================
class ProfileFile(BaseModel):
"""file from a crawl"""
Expand Down
2 changes: 1 addition & 1 deletion backend/btrixcloud/storages.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ async def get_presigned_url(org, crawlfile, crawl_manager, duration=3600):
s3storage = org.storage

else:
raise Exception("No Default Storage Found, Invalid Storage Type")
raise TypeError("No Default Storage Found, Invalid Storage Type")

async with get_s3_client(s3storage, s3storage.use_access_for_presign) as (
client,
Expand Down
1 change: 0 additions & 1 deletion backend/btrixcloud/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,6 @@ async def get_invite_info(token: str, email: str):
async def get_existing_user_invite_info(
token: str, user: User = Depends(current_active_user)
):

try:
invite = user.invites[token]
except:
Expand Down