mirror of https://gitlab.crans.org/bde/nk20
Remove test code
This commit is contained in:
parent
49bda926c6
commit
29f84ea007
|
@ -218,26 +218,18 @@ class Transaction(PolymorphicModel):
|
||||||
# When source == destination, no money is transferred and no transaction is created
|
# When source == destination, no money is transferred and no transaction is created
|
||||||
return
|
return
|
||||||
|
|
||||||
self.log("Saving")
|
|
||||||
# We save first the transaction, in case of the user has no right to transfer money
|
# We save first the transaction, in case of the user has no right to transfer money
|
||||||
super().save(*args, **kwargs)
|
super().save(*args, **kwargs)
|
||||||
self.log("Saved")
|
|
||||||
|
|
||||||
# Save notes
|
# Save notes
|
||||||
self.source.refresh_from_db()
|
self.source.refresh_from_db()
|
||||||
self.source.balance += diff_source
|
self.source.balance += diff_source
|
||||||
self.source._force_save = True
|
self.source._force_save = True
|
||||||
self.source.save()
|
self.source.save()
|
||||||
self.log("Source saved")
|
|
||||||
self.destination.refresh_from_db()
|
self.destination.refresh_from_db()
|
||||||
self.destination.balance += diff_dest
|
self.destination.balance += diff_dest
|
||||||
self.destination._force_save = True
|
self.destination._force_save = True
|
||||||
self.destination.save()
|
self.destination.save()
|
||||||
self.log("Destination saved")
|
|
||||||
|
|
||||||
def log(self, msg):
|
|
||||||
with open("/tmp/log", "a") as f:
|
|
||||||
f.write(msg + "\n")
|
|
||||||
|
|
||||||
def delete(self, **kwargs):
|
def delete(self, **kwargs):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -65,8 +65,6 @@ class InstancedPermission:
|
||||||
obj._force_delete = True
|
obj._force_delete = True
|
||||||
Model.delete(obj)
|
Model.delete(obj)
|
||||||
|
|
||||||
with open("/tmp/log", "w") as f:
|
|
||||||
f.write(str(obj) + ", " + str(obj.pk) + ", " + str(self.model.model_class().objects.filter(pk=0).exists()))
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
if permission_type == self.type:
|
if permission_type == self.type:
|
||||||
|
|
Loading…
Reference in New Issue