From 29f84ea0077ad6cb05f1efb456f8e09ff6c333b8 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Sun, 9 Aug 2020 15:42:07 +0200 Subject: [PATCH] Remove test code --- apps/note/models/transactions.py | 8 -------- apps/permission/models.py | 2 -- 2 files changed, 10 deletions(-) diff --git a/apps/note/models/transactions.py b/apps/note/models/transactions.py index 9ee82188..b3a541a1 100644 --- a/apps/note/models/transactions.py +++ b/apps/note/models/transactions.py @@ -218,26 +218,18 @@ class Transaction(PolymorphicModel): # When source == destination, no money is transferred and no transaction is created return - self.log("Saving") # We save first the transaction, in case of the user has no right to transfer money super().save(*args, **kwargs) - self.log("Saved") # Save notes self.source.refresh_from_db() self.source.balance += diff_source self.source._force_save = True self.source.save() - self.log("Source saved") self.destination.refresh_from_db() self.destination.balance += diff_dest self.destination._force_save = True 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): """ diff --git a/apps/permission/models.py b/apps/permission/models.py index d49afdab..9136d30d 100644 --- a/apps/permission/models.py +++ b/apps/permission/models.py @@ -65,8 +65,6 @@ class InstancedPermission: obj._force_delete = True 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 if permission_type == self.type: