mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-06-20 17:41:55 +02:00
🐛 Prevent transactions to have the same source and destination
This commit is contained in:
@ -222,8 +222,7 @@ class Transaction(PolymorphicModel):
|
||||
self.destination_alias = str(self.destination)
|
||||
|
||||
if self.source.pk == self.destination.pk:
|
||||
# When source == destination, no money is transferred
|
||||
super().save(*args, **kwargs)
|
||||
# When source == destination, no money is transferred and no transaction is created
|
||||
return
|
||||
|
||||
self.log("Saving")
|
||||
|
Reference in New Issue
Block a user