Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
dimbleby committed Oct 1, 2023
1 parent 2e6ba3a commit 7b80005
Show file tree
Hide file tree
Showing 5 changed files with 241 additions and 251 deletions.
6 changes: 4 additions & 2 deletions admin_scripts/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ def upload_hint(level: int, hint: int, image: Path) -> None:
suffix = image.suffix
content_type = CONTENT_TYPES.get(suffix.lower())
if content_type is None:
raise RuntimeError(f"unrecognized suffix: {suffix}")
msg = f"unrecognized suffix: {suffix}"
raise RuntimeError(msg)

url = f"{SERVER}/api/levels/{level}/hint"
payload = {"number": hint}
Expand Down Expand Up @@ -103,7 +104,8 @@ def upload_level(level: int, path: Path) -> None:

# Should find exactly the right number - check the file extensions if not.
if len(images) != HINTS_PER_LEVEL:
raise RuntimeError(f"Found {len(images)} images in {path}")
msg = f"Found {len(images)} images in {path}"
raise RuntimeError(msg)

# Create the level.
upload_level_without_hints(level, path)
Expand Down
26 changes: 13 additions & 13 deletions azure/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 2 additions & 8 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,8 @@

def main() -> None:
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "treasure.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
from django.core.management import execute_from_command_line

execute_from_command_line(sys.argv)


Expand Down
Loading

0 comments on commit 7b80005

Please sign in to comment.