1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-11-26 18:37:12 +00:00

Remove test code

This commit is contained in:
Yohann D'ANELLO 2020-08-09 15:42:07 +02:00
parent 49bda926c6
commit 29f84ea007
2 changed files with 0 additions and 10 deletions

View File

@ -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):
""" """

View File

@ -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: