Skip to content

Commit

Permalink
fix(otis): better filename detector
Browse files Browse the repository at this point in the history
  • Loading branch information
vEnhance committed Feb 3, 2025
1 parent 8f5f8e2 commit b2f4efb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions venueQ/otis.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,9 +306,9 @@ def init_hook(self):
break
else:
url = f"https://storage.googleapis.com/otisweb-media/{data['upload__content']}"
_, ext = os.path.splitext(data["upload__content"])
ext = ext.lstrip(".")
ext = ext.lower()
fn = data["upload__content"]
assert "." in fn, f"Filename {fn} is not formatted correctly"
ext = fn[fn.rindex(".") + 1 :].lower()
assert ext in ProblemSet.EXTENSIONS, f"{ext} is not a valid extension"
self.ext = ext
logger.info(f"Trying to fetch {url}")
Expand Down

0 comments on commit b2f4efb

Please sign in to comment.