Projet

Général

Profil

« Précédent | Suivant » 

Révision 95593005

Ajouté par Serghei Mihai (congés, retour 15/05) il y a plus de 9 ans

dossiers: display notification on patient record contacts and addresses update

Closes #4807

Voir les différences:

calebasse/dossiers/views.py
94 94

  
95 95
new_patient_contact = NewPatientContactView.as_view()
96 96

  
97
class UpdatePatientContactView(RecordPatientRecordIdMixing, cbv.UpdateView):
97
class UpdatePatientContactView(RecordPatientRecordIdMixing, cbv.NotificationDisplayView, cbv.UpdateView):
98 98
    model = PatientContact
99 99
    form_class = forms.PatientContactForm
100 100
    template_name = 'dossiers/patientcontact_new.html'
101 101
    success_url = '../../view#tab=2'
102 102

  
103
    def form_valid(self, form):
104
        valid = super(UpdatePatientContactView, self).form_valid(form)
105
        messages.info(self.request, u'Modification enregistrée avec succès')
106
        return valid
107

  
108 103
update_patient_contact = UpdatePatientContactView.as_view()
109 104

  
110 105
class DeletePatientContactView(cbv.DeleteView):
......
143 138

  
144 139
new_patient_address = NewPatientAddressView.as_view()
145 140

  
146
class UpdatePatientAddressView(cbv.UpdateView):
141
class UpdatePatientAddressView(cbv.NotificationDisplayView, cbv.UpdateView):
147 142
    model = PatientAddress
148 143
    form_class = forms.PatientAddressForm
149 144
    template_name = 'dossiers/patientaddress_new.html'
150 145
    success_url = '../../view#tab=2'
151 146

  
152
    def form_valid(self, form):
153
        messages.add_message(self.request,
154
                messages.INFO,
155
                u'Modification enregistrée avec succès.')
156
        return super(UpdatePatientAddressView, self).form_valid(form)
157

  
158 147
update_patient_address = UpdatePatientAddressView.as_view()
159 148

  
160 149
class DeletePatientAddressView(cbv.DeleteView):
......
341 330

  
342 331
tab2_fiche_adm = PatientRecordAdmView.as_view()
343 332

  
344
class PatientRecordAddrView(cbv.ServiceViewMixin, cbv.MultiUpdateView):
333
class PatientRecordAddrView(cbv.ServiceViewMixin, cbv.NotificationDisplayView, cbv.MultiUpdateView):
345 334
    model = PatientRecord
346 335
    forms_classes = {
347 336
            'contact': forms.PatientContactForm,

Formats disponibles : Unified diff