summaryrefslogtreecommitdiff
path: root/archaeological_files
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_files')
-rw-r--r--archaeological_files/forms.py2
-rw-r--r--archaeological_files/views.py9
2 files changed, 5 insertions, 6 deletions
diff --git a/archaeological_files/forms.py b/archaeological_files/forms.py
index 27617f8ad..544c89048 100644
--- a/archaeological_files/forms.py
+++ b/archaeological_files/forms.py
@@ -46,7 +46,7 @@ from ishtar_common import widgets
class FileSelect(TableSelect):
towns = get_town_field()
in_charge = get_person_field(label=_(u"Person in charge"),
- person_type='sra_agent')
+ person_types=['sra_agent'])
file_type = forms.ChoiceField(label=_("File type"), choices=[])
saisine_type = forms.ChoiceField(label=_("Saisine type"), choices=[])
year = forms.IntegerField(label=_("Year"))
diff --git a/archaeological_files/views.py b/archaeological_files/views.py
index 1919d8b62..cda076cd9 100644
--- a/archaeological_files/views.py
+++ b/archaeological_files/views.py
@@ -35,11 +35,10 @@ from archaeological_operations.forms import ParcelFormSet
from forms import *
def autocomplete_file(request):
- person_types = request.user.ishtaruser.person.person_type
- if (not request.user.has_perm('ishtar_common.view_file', models.File) and \
- not request.user.has_perm('ishtar_common.view_own_file', models.File)
- and not person_types.rights.filter(wizard__url_name='file_search'
- ).count()):
+ person_types = person.person_type
+ if not request.user.has_perm('ishtar_common.view_file', models.File) and \
+ not request.user.has_perm('ishtar_common.view_own_file', models.File) \
+ and not request.user.ishtaruser.has_right('file_search'):
return HttpResponse(mimetype='text/plain')
if not request.GET.get('term'):
return HttpResponse(mimetype='text/plain')