def form_valid(self, form): response = super().form_valid(form) send_action(self.request.user, 'created the person', target=self.object) return response
def form_valid(self, form): album = form.save() self.success_url = album.get_absolute_url() action = 'added {} photos to the album'.format(form.photo_count) send_action(self.request.user, action, target=album) return super().form_valid(form)