aboutsummaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorAndrea Lepori <alepori@student.ethz.ch>2020-07-29 23:58:25 +0200
committerAndrea Lepori <alepori@student.ethz.ch>2020-07-29 23:58:25 +0200
commit9bb7b7bdfaf4130e1fa8e5f9baf93e9f977f7807 (patch)
treed136fde09ff4803aefc42f8dbd912ba563715faa /client
parentaccept terms on account creation (diff)
downloadscout-subs-9bb7b7bdfaf4130e1fa8e5f9baf93e9f977f7807.tar.gz
scout-subs-9bb7b7bdfaf4130e1fa8e5f9baf93e9f977f7807.zip
upload signed documents
Diffstat (limited to 'client')
-rw-r--r--client/migrations/0026_document_signed_doc.py18
-rw-r--r--client/models.py2
-rw-r--r--client/templates/client/index.html4
3 files changed, 22 insertions, 2 deletions
diff --git a/client/migrations/0026_document_signed_doc.py b/client/migrations/0026_document_signed_doc.py
new file mode 100644
index 0000000..f3b6747
--- /dev/null
+++ b/client/migrations/0026_document_signed_doc.py
@@ -0,0 +1,18 @@
+# Generated by Django 3.0.7 on 2020-07-29 19:58
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('client', '0025_documenttype_custom_group'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='document',
+ name='signed_doc',
+ field=models.FileField(default=None, null=True, upload_to='documents/'),
+ ),
+ ]
diff --git a/client/models.py b/client/models.py
index 4d8ae83..7c47cee 100644
--- a/client/models.py
+++ b/client/models.py
@@ -71,6 +71,8 @@ class Document(models.Model):
medical_data = models.ForeignKey(
MedicalData, default=None, on_delete=models.PROTECT, null=True)
+ signed_doc = models.FileField(default=None, upload_to='documents/', null=True)
+
class Meta:
permissions = [
("approved", "The user is approved")
diff --git a/client/templates/client/index.html b/client/templates/client/index.html
index 45a7e90..fd8316b 100644
--- a/client/templates/client/index.html
+++ b/client/templates/client/index.html
@@ -310,7 +310,7 @@
<div class="col s12">
<div class="card">
<div class="card-image">
- <img src="data:;base64,{{ doc.5 }}">
+ {% if doc.5 %} <img src="data:;base64,{{ doc.5 }}"> {% endif %}
</div>
</div>
</div>
@@ -319,7 +319,7 @@
<div class="col s12">
<div class="card">
<div class="card-image">
- <img src="data:;base64,{{ doc.6 }}">
+ {% if doc.6 %}<img src="data:;base64,{{ doc.6 }}">{% endif %}
</div>
</div>
</div>