cleanning code: fix some pylints warning like useless imports
This commit is contained in:
parent
488c701fcd
commit
3c5df84df6
|
@ -4,15 +4,10 @@ from datetime import date, time
|
|||
from django.db import models
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
import reversion
|
||||
|
||||
from calebasse.agenda.models import Event, EventType
|
||||
from calebasse.agenda.managers import EventManager
|
||||
from calebasse.actes.validation_states import VALIDATION_STATES
|
||||
from calebasse.ressources.models import ServiceLinkedAbstractModel
|
||||
from ..middleware.request import get_request
|
||||
|
||||
from validation_states import VALIDATION_STATES, NON_VALIDE
|
||||
|
||||
|
||||
class ActValidationState(models.Model):
|
||||
|
||||
|
|
|
@ -4,10 +4,9 @@ import datetime
|
|||
|
||||
from django.http import HttpResponseRedirect, HttpResponse
|
||||
from django.db.models import Q
|
||||
from django.views.generic.edit import ModelFormMixin
|
||||
from django.shortcuts import redirect
|
||||
|
||||
from calebasse.cbv import ListView, UpdateView, FormView, DeleteView
|
||||
from calebasse.cbv import ListView, UpdateView, DeleteView
|
||||
from calebasse.agenda.views import NewAppointmentView
|
||||
|
||||
import copy
|
||||
|
@ -20,8 +19,8 @@ def redirect_today(request, service):
|
|||
service=service)
|
||||
|
||||
class ActListingView(ListView):
|
||||
model=models.Act
|
||||
template_name='actes/act_listing.html'
|
||||
model = models.Act
|
||||
template_name = 'actes/act_listing.html'
|
||||
|
||||
def get_queryset(self):
|
||||
qs = super(ActListingView, self).get_queryset()
|
||||
|
|
|
@ -75,7 +75,7 @@ class Event(models.Model):
|
|||
(4, 'Une semaine sur quatre'),
|
||||
(5, 'Une semaine sur cinq')
|
||||
)
|
||||
OFFSET = range(0,4)
|
||||
OFFSET = range(0, 4)
|
||||
PERIODICITIES = (
|
||||
(1, u'Toutes les semaines'),
|
||||
(2, u'Une semaine sur deux'),
|
||||
|
|
|
@ -7,7 +7,6 @@ from datetime import datetime, date
|
|||
from dateutil.relativedelta import relativedelta
|
||||
from cPickle import loads, dumps
|
||||
|
||||
from django import forms
|
||||
from django.conf import settings
|
||||
from django.db import models
|
||||
from django.db.models import Min, Max, Q
|
||||
|
@ -16,13 +15,11 @@ from django.core.validators import MinValueValidator
|
|||
|
||||
import reversion
|
||||
|
||||
from calebasse.choices import (LARGE_REGIME_CHOICES, TYPE_OF_CONTRACT_CHOICES,
|
||||
DEFICIENCY_CHOICES)
|
||||
from calebasse.choices import TYPE_OF_CONTRACT_CHOICES, DEFICIENCY_CHOICES
|
||||
from calebasse.models import PhoneNumberField, ZipCodeField
|
||||
from calebasse.personnes.models import People
|
||||
from calebasse.ressources.models import (ServiceLinkedAbstractModel,
|
||||
NamedAbstractModel, Service)
|
||||
from calebasse.actes.validation import are_all_acts_of_the_day_locked
|
||||
NamedAbstractModel)
|
||||
from calebasse.actes.models import Act
|
||||
|
||||
DEFAULT_ACT_NUMBER_DIAGNOSTIC = 6
|
||||
|
@ -655,9 +652,9 @@ class PatientRecord(ServiceLinkedAbstractModel, PatientContact):
|
|||
except IndexError:
|
||||
pass
|
||||
else:
|
||||
if os.path.exists(fullpath) and not os.path.exists(next_fullpath):
|
||||
os.rename(fullpath, next_fullpath)
|
||||
continue
|
||||
if os.path.exists(fullpath) and not os.path.exists(next_fullpath):
|
||||
os.rename(fullpath, next_fullpath)
|
||||
continue
|
||||
if not os.path.exists(fullpath):
|
||||
os.makedirs(fullpath)
|
||||
for subdir in settings.PATIENT_SUBDIRECTORIES:
|
||||
|
@ -864,7 +861,9 @@ class PatientRecord(ServiceLinkedAbstractModel, PatientContact):
|
|||
today = date.today()
|
||||
current_hc_trait = None
|
||||
try:
|
||||
current_hc_trait = CmppHealthCareTreatment.objects.filter(patient=self,start_date__lte=today, end_date__gte=today).latest('start_date')
|
||||
current_hc_trait = CmppHealthCareTreatment.objects.filter(
|
||||
patient=self, start_date__lte=today, end_date__gte=today
|
||||
).latest('start_date')
|
||||
except:
|
||||
pass
|
||||
if not current_hc_trait:
|
||||
|
|
|
@ -5,11 +5,10 @@ import os
|
|||
from datetime import datetime, date
|
||||
|
||||
from django.conf import settings
|
||||
from django.core.urlresolvers import reverse_lazy
|
||||
from django.db import models
|
||||
from django.http import HttpResponseRedirect, HttpResponse
|
||||
from django.views.generic import View
|
||||
from django.views.generic.edit import DeleteView, FormMixin
|
||||
from django.views.generic.edit import DeleteView
|
||||
from django.contrib import messages
|
||||
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
|
||||
from django.core.files import File
|
||||
|
@ -28,7 +27,7 @@ from calebasse.dossiers.models import (PatientRecord, PatientContact,
|
|||
PatientAddress, Status, FileState, create_patient, CmppHealthCareTreatment,
|
||||
CmppHealthCareDiagnostic, SessadHealthCareNotification, HealthCare,
|
||||
TransportPrescriptionLog, ProtectionState)
|
||||
from calebasse.dossiers.states import STATES_MAPPING, STATE_CHOICES_TYPE, STATES_BTN_MAPPER
|
||||
from calebasse.dossiers.states import STATES_MAPPING, STATES_BTN_MAPPER
|
||||
from calebasse.ressources.models import (Service,
|
||||
SocialisationDuration, MDPHRequest, MDPHResponse)
|
||||
from calebasse.facturation.list_acts import list_acts_for_billing_CMPP_per_patient
|
||||
|
|
|
@ -4,7 +4,7 @@ from django.core.exceptions import PermissionDenied
|
|||
|
||||
class CalebasseLookup(LookupChannel):
|
||||
|
||||
def check_auth(self,request):
|
||||
def check_auth(self, request):
|
||||
if not request.user.is_authenticated():
|
||||
raise PermissionDenied
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ class BaseModelMixin(object):
|
|||
class PhoneNumberField(models.CharField):
|
||||
def __init__(self, *args, **kwargs):
|
||||
kwargs['max_length'] = 20
|
||||
super(PhoneNumberField, self).__init__(*args,**kwargs)
|
||||
super(PhoneNumberField, self).__init__(*args, **kwargs)
|
||||
|
||||
def formfield(self, **kwargs):
|
||||
default = { 'form_class': FRPhoneNumberField }
|
||||
|
|
Reference in New Issue