diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-12-16 01:37:42 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-12-16 01:37:42 +0100 |
commit | 6f34f50c623b852c15c8c5d09dab37bb6506d949 (patch) | |
tree | 348796a2c817d5ec2a0d06a4b386b7e72811da1d | |
parent | 42a1a0822b3e2c7a99d8fc6418a1e73820bb3ca3 (diff) | |
download | Ishtar-6f34f50c623b852c15c8c5d09dab37bb6506d949.tar.bz2 Ishtar-6f34f50c623b852c15c8c5d09dab37bb6506d949.zip |
Fix treament creation from treament file with no default treament for the the treament file
-rw-r--r-- | archaeological_finds/views.py | 3 | ||||
-rw-r--r-- | ishtar_common/views.py | 2 |
2 files changed, 3 insertions, 2 deletions
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, } diff --git a/ishtar_common/views.py b/ishtar_common/views.py index e1e5b3d17..72418e4fa 100644 --- a/ishtar_common/views.py +++ b/ishtar_common/views.py @@ -530,7 +530,7 @@ def autocomplete_user(request): def autocomplete_ishtaruser(request): if not request.user.has_perm('ishtar_common.view_person', models.Person): return HttpResponse('[]', content_type='text/plain') - q = request.GET.get('term') + q = request.GET.get('term', '') limit = request.GET.get('limit', 20) try: limit = int(limit) |