Révision 233fda5f
Ajouté par Mikaël Ates il y a plus de 9 ans
calebasse/dossiers/views.py | ||
---|---|---|
38 | 38 |
|
39 | 39 |
from ..utils import get_service_setting, is_validator, get_last_file |
40 | 40 |
|
41 |
if settings.CV2PARSER: |
|
42 |
import cv2parser |
|
43 |
|
|
41 | 44 |
class NewPatientRecordView(cbv.FormView, cbv.ServiceViewMixin): |
42 | 45 |
form_class = forms.NewPatientRecordForm |
43 | 46 |
template_name = 'dossiers/patientrecord_new.html' |
... | ... | |
347 | 350 |
ctx['nb_place_of_lifes'] = ctx['object'].addresses.filter(place_of_life=True).count() |
348 | 351 |
ctx['addresses'] = ctx['object'].addresses.order_by('-place_of_life', 'id') |
349 | 352 |
cv_files_path = get_service_setting('cv_files_path') |
350 |
if is_validator(self.request.user) and cv_files_path and os.path.isdir(cv_files_path): |
|
353 |
if settings.CV2PARSER and is_validator(self.request.user) and cv_files_path and os.path.isdir(cv_files_path):
|
|
351 | 354 |
ctx['cv2_reading'] = True |
352 | 355 |
return ctx |
353 | 356 |
|
... | ... | |
373 | 376 |
ctx['carte_vitale'] = filename |
374 | 377 |
return ctx |
375 | 378 |
|
376 |
read_cv2 = validator_only(ReadCV2View.as_view()) |
|
379 |
if settings.CV2PARSER: |
|
380 |
read_cv2 = validator_only(ReadCV2View.as_view()) |
|
377 | 381 |
|
378 | 382 |
class PatientRecordNotifsView(cbv.DetailView): |
379 | 383 |
model = PatientRecord |
Formats disponibles : Unified diff
Test if cv2parser module is present.