From cdbb28c80c5879bfad7179c959ec31062e801d11 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Sun, 16 Dec 2018 01:37:42 +0100 Subject: Fix treament creation from treament file with no default treament for the the treament file --- archaeological_finds/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'archaeological_finds/views.py') diff --git a/archaeological_finds/views.py b/archaeological_finds/views.py index 98ac7ee7b..20aa571e9 100644 --- a/archaeological_finds/views.py +++ b/archaeological_finds/views.py @@ -546,7 +546,8 @@ def treatment_add(request, pks, treatment_file=None): in_charge = request.user.ishtaruser.person dct = { "treatment_type": treatment_file.type.treatment_type.pk - if treatment_file.type else "", + if treatment_file.type and treatment_file.type.treatment_type + else "", "year": treatment_file.year, "person": in_charge.pk, } -- cgit v1.2.3