Skip to content
Snippets Groups Projects
Commit 426e27d1 authored by Samuel GAIST's avatar Samuel GAIST Committed by Flavio TARSETTI
Browse files

[libraries][templates] Use file field property to read content

Libraries have properties related to their file fields
that does the proper handling for reading their content
use that.
parent f8397cfc
No related branches found
No related tags found
2 merge requests!359Fix template FileField reading,!342Django 3 migration
......@@ -192,7 +192,7 @@
<div class="row">
<div class="col-sm-10 col-sm-offset-1">
<label for="source-code">Source code:</label>
<textarea id="source-code">{% if library %}{{ library.source_code_file.read }}{% endif %}</textarea>
<textarea id="source-code">{% if library %}{{ library.source_code }}{% endif %}</textarea>
<p class="help">{{ texts.library_code|safe }}</p>
</div>
</div>
......
......@@ -74,7 +74,7 @@
{% endwith %}
{% if open_source %}
<textarea class="form-control" id="code-display">{{ object.source_code_file.read }}</textarea>
<textarea class="form-control" id="code-display">{{ object.source_code }}</textarea>
<p class="help-block">{{ texts.code|safe }}</p>
{% else %}
<div class="alert alert-warning">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment