-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
catch extensions or themes unavailable to compiler, before compiling
if you set settings.MEDIA_ROOT to a relative path, it's possible that the Numbas compiler won't be able to find the file. The CompileObject view now checks that the paths to extensions and the selected theme exist before calling the compiler. Extension and theme paths are made relative to the editor's working directory (unless MEDIA_ROOT is set to an absolute path, as the documentation recommends) This all works to catch the cases when: - an extension file that should exist but doesn't - MEDIA_ROOT is set to a path relative to the editor working directory and throw a sensible error message rather than silently fail. Thanks to Stuart Simpson for bringing this to my attention.
- Loading branch information
1 parent
593c40e
commit a4ebdab
Showing
3 changed files
with
20 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,15 +1,23 @@ | |||
{% extends "base.html" %} | {% extends "base.html" %} | ||
{% block title %}Compilation Error{% endblock %} | {% block title %}Compilation Error{% endblock %} | ||
{% block body %} | {% block body %} | ||
<div class="container"> | |||
<div class="page-header"> | <div class="page-header"> | ||
<h1 class="text-warning">Compilation Error</h1> | <h1 class="text-warning">Compilation Error</h1> | ||
</div> | </div> | ||
<p><small>Attempted to compile at {% now "Y-m-d H:i:s" %}</small></p> | |||
{% autoescape on %} | {% autoescape on %} | ||
<p id="message">{{message}} (code {{code}})</p> | <p id="message">{{message}}</p> | ||
{% if stderr %} | |||
<h3>STDERR</h3> | <h3>STDERR</h3> | ||
<pre id="stderr"><code>{{stderr}}</code></pre> | <pre id="stderr"><code>{{stderr}}</code></pre> | ||
{% endif %} | |||
{% if stdout %} | |||
<h3>STDOUT</h3> | <h3>STDOUT</h3> | ||
<pre id="stdout"><code>{{stdout}}</code></pre> | <pre id="stdout"><code>{{stdout}}</code></pre> | ||
{% endautoescape %} | {% endif %} | ||
{% endautoescape %} | |||
<button class="btn btn-primary" onclick="window.location.reload()">Try again</button> | |||
</div> | |||
{% endblock %} | {% endblock %} | ||
|
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters