mirror of https://gitlab.crans.org/bde/nk20
Merge branch 'no_side_effect_permission_check' into 'beta'
No side effect permission check See merge request bde/nk20!124
This commit is contained in:
commit
ac2d1e8111
|
@ -388,7 +388,7 @@ $('#btn_transfer').click(function () {
|
||||||
alias = sources_notes_display[0].name
|
alias = sources_notes_display[0].name
|
||||||
source_id = user_note.id
|
source_id = user_note.id
|
||||||
dest_id = special_note
|
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 + ')' }
|
if (given_reason.length > 0) { reason += ' (' + given_reason + ')' }
|
||||||
}
|
}
|
||||||
$.post('/api/note/transaction/transaction/',
|
$.post('/api/note/transaction/transaction/',
|
||||||
|
|
|
@ -43,6 +43,7 @@ class InstancedPermission:
|
||||||
obj = copy(obj)
|
obj = copy(obj)
|
||||||
obj.pk = 0
|
obj.pk = 0
|
||||||
with transaction.atomic():
|
with transaction.atomic():
|
||||||
|
sid = transaction.savepoint()
|
||||||
for o in self.model.model_class().objects.filter(pk=0).all():
|
for o in self.model.model_class().objects.filter(pk=0).all():
|
||||||
o._force_delete = True
|
o._force_delete = True
|
||||||
Model.delete(o)
|
Model.delete(o)
|
||||||
|
@ -65,6 +66,7 @@ class InstancedPermission:
|
||||||
obj._no_signal = True
|
obj._no_signal = True
|
||||||
obj._force_delete = True
|
obj._force_delete = True
|
||||||
Model.delete(obj)
|
Model.delete(obj)
|
||||||
|
transaction.savepoint_rollback(sid)
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue