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/actes/views.py
86 86
    def form_valid(self, form):
87 87
        result = super(NewAct, self).form_valid(form)
88 88
        self.object.act.save()
89
        self.request.record('new-act',
90
                            '{obj_id} created by {user} from {ip}',
91
                            obj_id=self.object.id)
92 89
        return result
93 90

  
94 91
act_listing = ActListingView.as_view()
......
104 101
        if self.object.event:
105 102
            self.object.event.delete()
106 103
        if not self.object.is_billed:
107
            self.request.record('act-delete', '{obj_id} deleted by {user} from {ip}',
108
                                obj_id=self.object.id)
109 104
            self.object.delete()
110 105

  
111 106
        return HttpResponse(status=204)

Also available in: Unified diff