Skip to content

Commit

Permalink
remove exception since the function does not throw an exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Abdullah13521 committed Dec 4, 2024
1 parent cd468b3 commit 142b66d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions web/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1278,11 +1278,8 @@ def validate_input_data(self) -> Self:
is_base64 = re.match(base64_pattern, value) and len(value) % 4 == 0

# Validate URL
try:
parsed = urlparse(value)
is_url = all([parsed.scheme, parsed.netloc])
except Exception:
is_url = False
parsed = urlparse(value)
is_url = all([parsed.scheme, parsed.netloc])

if not (is_base64 or is_url):
raise ValueError(
Expand Down

0 comments on commit 142b66d

Please sign in to comment.