Project

General

Profile

« Previous | Next » 

Revision 8e6a3c86

Added by Serghei Mihai over 9 years ago

logging actions on models improved using post_save and pre_delete signals

View differences:

calebasse/agenda/forms.py
122 122
            if commit:
123 123
                appointment.patient = patient
124 124
                appointment.save()
125
                get_request().record('new-eventwithact',
126
                                    '{obj_id} created by {user} from {ip}',
127
                                     obj_id=appointment.id)
128 125
                self.save_m2m()
129 126
                appointment.services = [self.service]
130 127

  
......
145 142
        appointment.clean()
146 143
        if commit:
147 144
            appointment.save()
148
            get_request().record('update-eventwithact',
149
                                 '{obj_id} saved by {user} from {ip}',
150
                                 obj_id=appointment.id)
151 145
            self.save_m2m()
152 146
            appointment.services = [self.service]
153 147
        return appointment
......
233 227
        event.clean()
234 228
        if commit:
235 229
            event.save()
236
            get_request().record('new-event', '{obj_id} created by {user} from {ip}',
237
                                 obj_id=event.id)
238 230
            event.services = [self.service]
239 231
        return event
240 232

  

Also available in: Unified diff