Révision 6452a969
Ajouté par Mikaël Ates il y a plus de 9 ans
calebasse/dossiers/views.py | ||
---|---|---|
36 | 36 |
|
37 | 37 |
from calebasse.decorators import validator_only |
38 | 38 |
|
39 |
from ..utils import get_service_setting |
|
39 |
from ..utils import get_service_setting, is_validator
|
|
40 | 40 |
|
41 | 41 |
class NewPatientRecordView(cbv.FormView, cbv.ServiceViewMixin): |
42 | 42 |
form_class = forms.NewPatientRecordForm |
... | ... | |
347 | 347 |
ctx['nb_place_of_lifes'] = ctx['object'].addresses.filter(place_of_life=True).count() |
348 | 348 |
ctx['addresses'] = ctx['object'].addresses.order_by('-place_of_life', 'id') |
349 | 349 |
cv_files_path = get_service_setting('cv_files_path') |
350 |
if cv_files_path and os.path.isdir(cv_files_path): |
|
350 |
if is_validator(self.request.user) and cv_files_path and os.path.isdir(cv_files_path):
|
|
351 | 351 |
ctx['cv2_reading'] = True |
352 | 352 |
return ctx |
353 | 353 |
|
Formats disponibles : Unified diff
Button only visible for validator role.