From 1c3eab82aa7000d81397e7e73754541d12d6278f Mon Sep 17 00:00:00 2001 From: Reid Mello <30907815+rjmello@users.noreply.github.com> Date: Wed, 17 Aug 2022 23:53:41 -0400 Subject: [PATCH] Stop automatically populating File model name field with external source URLs --- src/cript/nodes/primary/file.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/cript/nodes/primary/file.py b/src/cript/nodes/primary/file.py index 27c1f66..f804587 100644 --- a/src/cript/nodes/primary/file.py +++ b/src/cript/nodes/primary/file.py @@ -1,7 +1,6 @@ import os from typing import Union from logging import getLogger -from urllib.parse import urlparse from beartype import beartype @@ -76,11 +75,8 @@ def source(self, value): self.name = os.path.basename(value) self.extension = os.path.splitext(value)[-1] - elif value.startswith(("http://", "https://")): - parsed_url = urlparse(value) - self.name = parsed_url.netloc + parsed_url.path - + pass else: raise FileNotFoundError( "The file could not be found on the local filesystem."