diff --git a/apps/note/static/note/js/transfer.js b/apps/note/static/note/js/transfer.js index db9cf9ac..f6b23b29 100644 --- a/apps/note/static/note/js/transfer.js +++ b/apps/note/static/note/js/transfer.js @@ -388,7 +388,7 @@ $('#btn_transfer').click(function () { alias = sources_notes_display[0].name source_id = user_note.id dest_id = special_note - reason = 'Retrait ' + $('#credit_type option:selected').text().toLowerCase() + reason = 'Retrait ' + $('#debit_type option:selected').text().toLowerCase() if (given_reason.length > 0) { reason += ' (' + given_reason + ')' } } $.post('/api/note/transaction/transaction/', diff --git a/apps/permission/models.py b/apps/permission/models.py index ee7d3ec4..17214894 100644 --- a/apps/permission/models.py +++ b/apps/permission/models.py @@ -43,6 +43,7 @@ class InstancedPermission: obj = copy(obj) obj.pk = 0 with transaction.atomic(): + sid = transaction.savepoint() for o in self.model.model_class().objects.filter(pk=0).all(): o._force_delete = True Model.delete(o) @@ -65,6 +66,7 @@ class InstancedPermission: obj._no_signal = True obj._force_delete = True Model.delete(obj) + transaction.savepoint_rollback(sid) return ret