Button only visible for validator role.

This commit is contained in:
Mikaël Ates 2015-01-13 14:54:41 +01:00
parent eb7374357d
commit 6452a96921
1 changed files with 2 additions and 2 deletions

View File

@ -36,7 +36,7 @@ from calebasse.facturation.invoice_header import render_to_pdf_file
from calebasse.decorators import validator_only
from ..utils import get_service_setting
from ..utils import get_service_setting, is_validator
class NewPatientRecordView(cbv.FormView, cbv.ServiceViewMixin):
form_class = forms.NewPatientRecordForm
@ -347,7 +347,7 @@ class PatientRecordAddrView(cbv.ServiceViewMixin, cbv.NotificationDisplayView, c
ctx['nb_place_of_lifes'] = ctx['object'].addresses.filter(place_of_life=True).count()
ctx['addresses'] = ctx['object'].addresses.order_by('-place_of_life', 'id')
cv_files_path = get_service_setting('cv_files_path')
if cv_files_path and os.path.isdir(cv_files_path):
if is_validator(self.request.user) and cv_files_path and os.path.isdir(cv_files_path):
ctx['cv2_reading'] = True
return ctx