Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
neoformit committed Dec 17, 2024
2 parents 4ff59be + 6947cb7 commit bca8e6d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
File renamed without changes.
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ RUN apt-get update
WORKDIR /srv/labs-engine/app
COPY requirements.txt /tmp/requirements.txt
RUN pip install -r /tmp/requirements.txt

EXPOSE 8000
CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]
6 changes: 6 additions & 0 deletions app/labs/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import logging
import os
import traceback
from django.conf import settings
from django.http import HttpResponse
from django.shortcuts import render
Expand Down Expand Up @@ -47,6 +48,7 @@ def export_lab(request):
})
context.validate()
except LabBuildError as exc:
logger.warning(f"Error building lab: {traceback.format_exc()}")
return render(request, 'labs/export-error.html', {
'exc': exc,
}, status=400)
Expand All @@ -66,6 +68,10 @@ def export_lab(request):
template_str = t.render(RequestContext(request, context))
i += 1
except Exception as exc:
logger.error(
f"Error rendering template for"
f" content_root={request.GET.get('content_root')}:"
f"\n{traceback.format_exc()}")
return report_exception_response(request, exc)

response = LabCache.put(request, template_str)
Expand Down

0 comments on commit bca8e6d

Please sign in to comment.