mirror of
				https://gitlab.crans.org/bde/nk20
				synced 2025-10-31 07:49:57 +01:00 
			
		
		
		
	clean specialTransaction
This commit is contained in:
		| @@ -252,6 +252,17 @@ class SpecialTransaction(Transaction): | ||||
|     def type(self): | ||||
|         return _('Credit') if isinstance(self.source, NoteSpecial) else _("Debit") | ||||
|  | ||||
|     def is_credit(self): | ||||
|         return isinstance(self.source, NoteSpecial) | ||||
|  | ||||
|     def is_debit(self): | ||||
|         return isinstance(self.destination, NoteSpecial) | ||||
|  | ||||
|     def clean(self): | ||||
|         # SpecialTransaction are only possible with NoteSpecial object | ||||
|         if self.is_credit() == self.is_debit(): | ||||
|             raise(ValidationError(_("A special transaction is only possible between a  Note associated to a payment method and a User or a Club"))) | ||||
|  | ||||
|  | ||||
| class MembershipTransaction(Transaction): | ||||
|     """ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user